#include #define FOR(i, a, b) for(int (i) = (a); (i) < (b); ++(i)) #define REP(i, n) FOR(i, 0, n) constexpr int MAX_SIZE = 2e5 + 10; char str[MAX_SIZE]; int main(void){ int n; scanf("%d%s", &n, str); int res = 0, one = 0, nine = 0; REP(i, n){ switch(str[i]){ case '1': one++; break; case '3': case '5': case '7': res++; break; case '9': if(one >= 1){one--; res++;} else nine++; break; } } int d = (one > nine / 2) ? nine / 2 : one; res += d; one -= d; res += one / 2; printf("%d\n", res); return 0; }