N, M = gets.split.map(&:to_i) p (1..N).count { a, b = gets.split b.to_i >= 1200 and a[0, 4] =~ /x/ }