#include <iostream> #include <stdio.h> #include <cmath> using namespace std; int main(){ int M, P, L, E, R, S, N; int mos, pup, lar, newlar; while (cin >> M >> P >> L >> E >> R >> S >> N) { mos = M; pup = P; lar = L; while (N--) { newlar = mos * E; mos = pup / S; pup = lar / R; lar = newlar; } cout << mos << endl; } return 0; }