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

using ll = long long;
using pii = pair<int, int>;
template <class T>
using v = vector<T>;
template <class T>
using vv = v<v<T>>;
#define ALL(c) (c).begin(), (c).end()

int digit(ll i)
{
    ll r = i;
    int ret = 0;
    while (r != 0)
    {
        r /= 10;
        ret++;
    }
    return ret;
}

int main()
{
    ll N;
    cin >> N;
    int ans = INT32_MAX;
    for (ll i = 1; i <= sqrt(N); i++)
    {
        int f = INT32_MAX;
        if (N == N / i * i)
        {
            f = max(digit(i), digit(N / i));
        }
        ans = min(ans, f);
    }

    cout << ans << endl;

    return 0;
}
#include<bits/stdc++.h>
#define ll long long
#define ld long double
#define F first
#define S second
#define Tsetso ios_base::sync_with_stdio(0) ; cin.tie(0) ;
using namespace std;
const ll N = 1e5+10, inf = 1e3+5, mod = 1e9+7, NN = 1e5+10;
int a ;
int main()
{
    Tsetso ;
    int n  , mn = 1e9 ;
    cin >> n ;
    for ( int i = 0 ; i  <n ; i++)
    {
        int cnt = 0 ;
        cin >> a ;
        while (a%2 == 0)
                a /= 2 , cnt++ ;
        mn = min(cnt,mn) ;
    }
    cout << mn ;
}
