# -*- coding: utf-8 -*- x, y, d = map(int, raw_input().split()) if x >= d and y >= d: print d + 1 elif x < d and y >= d: print x + 1 elif x >= d and y < d: print y + 1 else: print max(x + y + 1 - d, 0)