#!/usr/bin/python x, y, d = map(int, raw_input().split()) print max(0, d + 1 - max(0, d-x) - max(0, d-y))