#include int main(void){ int n; scanf("%d\n", &n); int res = 0, one = 0, nine = 0; for(int i = 0; i < n; ++i){ switch(getchar()){ 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; }