#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define len(val) static_cast(val.size()) #define rep(i, N) for(int i=0; i P; int main() { cin.tie(0); ios::sync_with_stdio(false); int x, y, d; cin >> x >> y >> d; int res; if(x > d){ if(y > d){ res = (d+1); }else if(y == d){ res = (d-x+y+1); }else{ res = (d-x+y+2); } }else if(x == d){ if(y > d){ res = (d+1); }else if(y == d){ res = (d+1); }else{ res = (y+1); } }else{ if(y > d){ res = (x+1); }else if(y == d){ res = (d-y+x+1); }else{ res = (x+y-d+1); } } cout << (res < 0 ? 0 : res) << endl; }