let n = readLine()!.split(separator: " ").map{Int($0)!} var s = Set() for i in n[0]...n[1]{ s.insert(i % n[2]) } print(s.count)