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