#include <stdio.h>
#include <math.h>
float getage(int w,float y,double x,int newage)
{
return (1-x)*(y+1)+x*newage;
}
int main()
{
int w,n;
float x,y;
while(scanf("%d %f %f %d",&w,&y,&x,&n)!=EOF){
float answer;
while(n>0)
{
answer=getage(w,y,x,21);
y=answer;
n--;
}
int a=ceil(answer);
printf("%d\n",a);
}
return 0;
}