# -*- coding: utf-8 -*- a,b,d = map(int, input().split()) x = d y = 0 ans = 0 while x >= 0: if x <= a and y <= b: ans += 1 x -= 1 y += 1 print(ans)