#include #include using namespace std; int main(){ int N; cin >> N; int ok_type = 0, miss_type = 0; for(int i = 0; i < N; i++){ int T; string S; cin >> T >> S; ok_type += min(T * 3 / 250, int(S.size())); miss_type += max(int(S.size()) - T * 3 / 250, 0); } cout << ok_type << " " << miss_type << endl; }