n, m, k = map(int, input().split()) ans = 0 while n >= 2 and m >= 1 and (n+m) >= k + 3 : n, m , ans = n-2, m-1, ans+1 print(ans)