# -*- coding:utf-8 -*- import math if __name__ == "__main__": x,y,d = map(int,raw_input().split()) if x < d and y < d: print 0 else: print int(math.fabs(min(d,y) - min(d,x) + d) + 1)