#include using namespace std; int main() { int N; cin >> N; int miss = 0; long long total = 0; for (int i = 0; i < N; i++) { long long T; string S; cin >> T >> S; int S_N = S.size(); total += S_N; long long type_count = (12 * T / 1000); if (type_count < S_N) { miss += S_N - type_count; } } cout << total - miss << " " << miss; }