#include<bits/stdc++.h> using namespace std; int main(){ int x,y,d; cin>>x>>y>>d; if(x+y<d)cout<<0; else{ cout<<d+1-max(0,d-x)-max(0,d-y)<<endl; } }