#include #include #include using namespace std; int N; int T; string S; int main() { cin >> N; int cnt[2]; for (int i = 0; i < N; i++) { cin >> T >> S; int ma = T * 12 / 1000; cnt[0] += min(ma, (int)S.length()); cnt[1] += max(0, (int)S.length() - ma); } cout << cnt[0] << " " << cnt[1] << endl; return 0; }