#include <iostream> using namespace std; int main() { int n, a; cin >> n; int ans = 0; while (n--) { cin >> a; if (a % 9 == 0 && a % 8 != 0) ans++; } cout << ans; return 0; }