X,Y,Z = map(int,input().split()) ans = Z-(X<=Z)-(Y<=Z) print(ans)