#include using namespace std; int main() { int a,b,c,d,e; cin >> a >> b >> c >> d >> e; std::cout << (a+c*d) - (b+c*e) << "\n"; }