let n = readLine()!.split(separator: " ").map{Int($0)!} print([n[2],n[1]-n[0]+1].min()!)