a, b, c = map(int, input().split()) m, s = max(a,b,c), sum([a,b,c]) print(s if 2*m < s else 2 * (s - m) - 1)