// yukicoder 857 素振り
// 2019.8.10 bal4u

#include <stdio.h>

int main()
{
	long long X, Y, Z, ans;

	scanf("%lld%lld%lld", &X, &Y, &Z);
	ans = Z;
	if (X <= Z) ans--;
	if (Y <= Z) ans--;
	printf("%lld\n", ans);
	return 0;
}