#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll INF = LONG_LONG_MAX / 2;
const ll mod = 1000000000 + 7;
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};

int main() {
  ll N;
  cin >> N;
  ll sqrN = sqrt(N);
  for (ll i = sqrN; i >= 1; i--) {
    if (N % i == 0) {
      ll a = N / i;
      string sa = to_string(a);
      cout << sa.size() << endl;
      return 0;
    }
  }
}

#include<bits/stdc++.h>
using namespace std;

#define ll long long

ll F(ll A, ll B){
    string bufA = to_string(A), bufB = to_string(B);
    return max(bufA.size(), bufB.size());
}

int main(){
    ll N;
    ll ans = to_string(N).size();
    cin >> N;
    for(ll i = 1; i <= sqrt(N); ++i){
        if(N % i == 0) ans = min(ans, F(i, N/i));
    }
    cout << ans << endl;
    return 0;
}