#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; typedef long long int ll; typedef pair pii; typedef tuple t3; ll dp[100010]; int main() { int b1,b2,b3; cin >> b1 >> b2 >> b3; if(b2 == 0 && b3 == 0) { cout << 0 << endl; return 0; } double d1 = b2 - b1; double d2 = b3 - b2; double r = d2 / d1; double d = b2 - r * b1; //cout << "r:" << r << ",d:" << d << endl; double result = b3 * r + d; cout << (ll)round(result) << endl; return 0; }