import sequtils,strutils var res = 0 for _ in 1..1000: let nk = stdin.readline().split().map(parseInt) let (n,k) = (nk[0],nk[1]) # n - 1 == a * (k + 1) の時敗北 if (n - 1) mod (k + 1) != 0: res += 1 echo res