#include #include #include #include #include #include #include using namespace std; #define int long long #define endl "\n" const long long INF = (long long)1e18; const long long MOD = 1'000'000'007; string yn(bool f){return f?"Yes":"No";} string YN(bool f){return f?"YES":"NO";} signed main(){ cin.tie(nullptr); ios::sync_with_stdio(false); cout<>N; cin>>S; for(int i = 0; i < N; i++){ if(S[i] == '1') { if(con9 >= 1){ con9 -= 1; con++; } else { con1++; } } else if(S[i] == '9'){ if(con1 >= 1){ con1--; con++; } else { con9++; } } else { con++; } } con += con1/2; cout<