#include #include #include #include #include #include #include #include #include #include #include #include #define vll vector #define vvvl vector #define vvl vector> #define VV(a, b, c, d) vector>(a, vector(b, c)) #define VVV(a, b, c, d) vector(a, vvl(b, vll (c, d))); #define re(c, b) for(ll c=0;c> n; string s;std::cin >> s; ll ans = 0; ll o = 0, q = 0; for(int i=0;i=2){ q-=2; ans++; }else{ o++; } } if(s[i]=='9'){ if(o){ o--; ans++; }else{ q++; } } } } ans += o/2; std::cout << ans << '\n'; }