n,k,b = map(int,input().split()) c = 0 for i in range(n): x,y = map(int,input().split()) if k*x+b == y: c += 1 print(c)