#include <iostream>
#include <iomanip>
using namespace std;
int main() {
double s;
int p, d;
int dM[12] = {31, 28, 31, 30 ,31, 30, 31, 31, 30, 31, 30, 31};
cin>>s>>p>>d;
int day, month;
char a;
cin>>day>>a>>month;
month--;
int dP = 0;
for(int i = month; dP < d; i++){
double z = 0;
for(int j = (i==month?day : 1); j <= dM[i] && dP < d; j++){
dP++;
z += s*(p/100.0)*(1/365.0);
}
s += z;
}
cout<<fixed<<setprecision(6)<<s;
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8aW9tYW5pcD4KIAp1c2luZyBuYW1lc3BhY2Ugc3RkOwppbnQgbWFpbigpIHsKICAgIGRvdWJsZSBzOwogICAgaW50IHAsIGQ7CiAgICBpbnQgZE1bMTJdID0gezMxLCAyOCwgMzEsIDMwICwzMSwgMzAsIDMxLCAzMSwgMzAsIDMxLCAzMCwgMzF9OwogICAgY2luPj5zPj5wPj5kOwogICAgaW50IGRheSwgbW9udGg7CiAgICBjaGFyIGE7CiAgICBjaW4+PmRheT4+YT4+bW9udGg7CiAgICBtb250aC0tOwogICAgaW50IGRQID0gMDsKICAgIGZvcihpbnQgaSA9IG1vbnRoOyBkUCA8IGQ7IGkrKyl7CiAgICAgICAgZG91YmxlIHogPSAwOwogICAgICAgIGZvcihpbnQgaiA9IChpPT1tb250aD9kYXkgOiAxKTsgaiA8PSBkTVtpXSAmJiBkUCA8IGQ7IGorKyl7CiAgICAgICAgICAgIGRQKys7CiAgICAgICAgICAgIHogKz0gIHMqKHAvMTAwLjApKigxLzM2NS4wKTsKICAgICAgICB9CiAgICAgICAgcyArPSB6OwogICAgfQogICAgY291dDw8Zml4ZWQ8PHNldHByZWNpc2lvbig2KTw8czsKICAgIHJldHVybiAwOwp9