#include using namespace std; int N; string s; int ans, one, nine; int main() { cin >> N >> s; for (int i = 0; i < N; i++) { if (s[i] == '3' || s[i] == '7' || s[i] == '5') ans++; if (s[i] == '1') { one++; } if (s[i] == '9') { if (0 < one) { ans++; one--; } else { nine++; } } } int cnt = min(nine / 2, one); ans += cnt; ans += (one - cnt) / 2; cout << ans << endl; return 0; }