#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for (int i = 0; i < (n); i++) 
#define all(v) begin(v),end(v)
using ll = long long;

int main() {
  ll n;cin>>n;
  int ans=1e9;
  for(int i=1;i<=sqrt(n);i++){
    if(n%i!=0)continue;
    ll j=n/i;
    string I=to_string(i),J=to_string(j);
    int a=I.size(),b=J.size();
    int f=max(a,b);
    ans=min(ans,f);
  }
  cout<<ans<<endl;
}
#include <algorithm>
#include <cmath>
#include <iostream>
using namespace std;
using ll = int64_t;
#define rep(i, j, n) for (int i = j; i < (int)n; ++i)
#define rrep(i, j, n) for (int i = (int)n - 1; j <= i; --i)

int main() {
  ll n;
  cin >> n;
  ll m = (ll)sqrt((double)n);

  auto d = [](ll x) {
    ll res = 0;
    while (x) {
      x /= 10;
      res++;
    }
    return res;
  };

  rrep(i, 1, m + 1) {
    if (n % i == 0) {
      cout << max(d(i), d(n / i)) << '\n';
      return 0;
    }
  }
  return 0;
}
