#include <bits/stdc++.h> using namespace std; int main() { int m, n, a, b, c, d, s = 0; cin >> m; for (int i = 0; i < m; i++) { cin >> n; a = n / 1000; b = (n - 1 * 1000) / 100; c = (n - a * 1000 - b * 100) / 10; d = n - a * 1000 - b * 100 - c * 10; if (d - a - b - c > 0) { s++; } } cout << s << endl; return 0; }