#include using namespace std; int main() { int N; cin >> N; int ac = 0, wa = 0; while (N--) { int T; string S; cin >> T >> S; T = (T * 12) / 1000; ac += min(T, (int)S.size()); wa += max(0, (int)S.size() - T); } cout << ac << " " << wa << endl; }