#include <bits/stdc++.h>
#define INF 1e9
#define endl '\n'
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define RFOR(i, a, b) for (int i = (b)-1; i >= (a); --i)
#define FORE(i, a, b) for (int i = (a), e = (b); i < e; ++i)
#define RFORE(i, a, b) for (int i = (b)-1, e = (a); i >= e; --i)
#define ALL(x) (x).begin(), (x).end()
#define SORT(c) sort((c).begin(), (c).end())
#define SORTR(c) sort((c).begin(), (c).end(), greater<int>())
using namespace std;
long long digits(long long num) {
    long long digit = num;
    int       d_sum = 0;
    while (digit > 0) {
        ++d_sum;
        digit /= 10;
    }
    return d_sum;
}
int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    long long N;
    cin >> N;
    long long ans = INF;
    for (long long A = 1; A < sqrt(N) + 1; ++A) {
        if (N % A == 0) { ans = min(ans, max(digits(A), digits(N / A))); }
    }
    cout << ans << endl;
}

#include<stdio.h>
#define INF (1<<30)-1
int main(){
  int n;
  scanf("%d",&n);
  int s[n];
  int i,j,c=INF;
  for(i=0;i<n;i++){
    scanf("%d",&s[i]);
    if(s[i]<c) c = s[i];
  }
  for(i=1;i<=c;i++){
    int ok = 0;
    for(j=0;j<n;j++) if(s[j]%i!=0) ok = 1;
    if(ok == 0) printf("%d\n",i);
  }
}