#include #include #include #include #include #include #include using namespace std; using uint = unsigned int; using ll = long long; #define CIN( LL , A ) LL A; cin >> A #define GETLINE( A ) string A; getline( cin , A ) #define FOR_ITR( ARRAY , ITR , END ) for( auto ITR = ARRAY .begin() , END = ARRAY .end() ; ITR != END ; ITR ++ ) void CountZero( ll& P , ll& num_P ) { P /= 10; num_P = 0; while( P != 1 ){ P /= 10; num_P++; } return; } int main() { ll P = 1000000007; ll num_P; CountZero( P , num_P ); CIN( ll , N ); ll num_N; CountZero( N , num_N ); ll answer = num_P < num_N ? num_N - num_P : num_P - num_N; cout << answer << endl; return 0; }