#include int main(void){ int x, y, z; scanf("%d%d%d", &x, &y, &z); int rest=0; if(x<=z) rest++; if(y<=z) rest++; printf("%d\n", z-rest); return 0; }