#include <bits/stdc++.h>   using namespace std;   int INP() {     int n, flag;     char c;     n = 0;     flag = 1;     c = getchar();     while (c < 33) {       c = getchar();     }     if (c ==  - ) {       flag = -1;       c = getchar();     }     while (c > 32) {       n = n * 10 + c -  0 ;       c = getchar();     }     n = n * flag;     return n;   }   int GCD(int a, int b) { return (a % b == 0 ? b : GCD(b, a % b)); }   int main() {     int n, i, idx, ans, stop;     string s, s1, mx;     vector<string> v;     cin >> s;     n = s.size();     mx =  0 ;     for (i = 0; i < n; i++) {       s1.push_back(s[i]);       if (s[i + 1] !=  0 ) {         v.push_back(s1);         if (s1.size() > mx.size()) {           mx = s1;           idx = v.size();         } else if (s1.size() == mx.size() && s1 > mx) {           mx = s1;           idx = v.size();         }         s1.clear();       }     }     s1.clear();     for (i = 0; i < idx; i++) {       if (s1.size() > v[i].size()) {         stop = min(stop, i - 1);       } else if (s1.size() == v[i].size() && s1 >= v[i]) {         stop = min(stop, i - 1);       }       if (s1.size() < v[i].size()) {         stop = INT_MAX;       } else if (s1.size() == v[i].size() && v[i] > s1) {         stop = INT_MAX;       }       s1 += v[i];       if (s1.size() > mx.size()) {         ans = v.size() - min(i, stop);         break;       } else if (s1.size() == mx.size() && s1 >= mx) {         ans = v.size() - min(i, stop);         break;       }     }     printf( %d n , ans);     return 0;   }   