using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; class Magatro { static void Main() { int cnt = 0; for(int i = 0; i < 1000; i++) { int[] NK = Console.ReadLine().Split(' ').Select(s => int.Parse(s)).ToArray(); cnt += (NK[0] - 1) % (NK[1] + 1) == 0 ? 1 : 0; } Console.WriteLine(cnt); } }