var score = [0,0] let N = Int(readLine()!) for _ in 1...N!{ let input = readLine()?.split(separator: " ") let time = Int(input![0]) let string = input![1] let max = time! / (1000/12) let good = min( max, string.count) let bad = string.count - good score[0] += good score[1] += bad } print(score[0],terminator: " ") print(score[1])