n = gets.to_i success = 0 failed = 0 n.times do a, b = gets.chomp.split a = a.to_i b = b.count("a-z") need_time = b / 0.012 a = need_time if a > need_time max_string = (a * 0.012).floor success += max_string failed += b - max_string end ans = [] ans.push(success, failed) puts ans.join(" ")