#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++; } } } ans += one / 2; one %= 2; if (2 <= nine && 1 <= one) ans++; cout << ans << endl; return 0; }