l, r, n = map(int, input().split()) even = [i for i in range(l, r+1) if i % n == 0] odd = [i for i in range(l, r+1) if i % n == 1] print(len(even)) print(len(odd))