#include #include using namespace std; int main(void) { int A,B,S; cin >> A >> B >> S; S*=2; S-=(abs(S-A)