INF = 10 ** 9 import sys sys.setrecursionlimit(100000000) dy = (-1,0,1,0) dx = (0,1,0,-1) from heapq import heappop,heapify,heappush from bisect import bisect_left def main(): x,y,z = map(int,input().split()) if z < x: print(z) elif z < y: print(z - 1) else: print(z - 2) if __name__ == '__main__': main()