#include <cstdlib> #include <cstdio> #include <iostream> using namespace std; int main () { int M,P,L,E,R,S,N,lastM; while (scanf("%d%d%d%d%d%d%d\n",&M,&P,&L,&E,&R,&S,&N)==7) { for (int i = 1; i <= N; i++) { lastM = M; M = P/S; P = 0; P = L/R; L = 0; L = lastM*E; } cout << M << endl; } return 0; }