#include int main(void){ int X,Y,Z,c=0; scanf("%d %d %d",&X,&Y,&Z); if(X<=Z){ c++; } if(Y<=Z){ c++; } printf("%d",Z-c); return 0; }