Spadework 2020. 2. 4. 10:10

* Solved 기준 브론즈3 단순 풀이

print(sum(map(lambda e: int(e[1])%int(e[0]), [input().split() for _ in range(int(input()))])))