#include #include using namespace std; void f(int x,int y,int d){ if(x+yy){ int t=x; x=y; y=t; } if(d<=x){ printf("%d\n",d+1); }else if(d<=y){ printf("%d\n",x+1); }else{ printf("%d\n",x+y-d+1); } } int main() { // your code goes here int x,y,d; scanf("%d %d %d",&x,&y,&d); f(x,y,d); return 0; }