#include <bits/stdc++.h>
#define PI 3.14159265359
#define NIL -1
using namespace std;
const int64_t MOD = 1e9 + 7;

int main() {
	int64_t N;
	cin >> N;

	int64_t rt = sqrt(N);
	for (int64_t i = rt; i > 0; i--) {
		if (N % i == 0) {
			//cout << i << endl;
			int64_t n = N / i;

			int64_t cnt = 0;
			int64_t m = N / i;
			while (m) {
				cnt++;
				m /= 10;
			}

			cout << cnt << endl;
			return 0;
		}
	}
}
#include<iostream>
using namespace std;

int count(long long n){
    int cnt=0;
    while(n>0){
        n/=10;
        cnt++;
    }
    return cnt;
}

int main(){
    long long n;
  	long long b;
    int cur=0;
  	int ans=100000;
    cin>>n;
    for(long long i=1;i*i<=n;i++){
       if(n%i==0){
       b=n/i;
       cur=max(count(i),count(b));
       if(ans>cur)ans=cur;
        }
    }
    cout<<ans<<endl;
    return 0;
}