#include #include #include #include #include #include #include int main() { int p; int d,h,rs=0; int m; int s; scanf("%i %i %i %i", &p, &d, &m, &s); int c=0; if(s<20) c=0; else { h=20; rs=20; c=1; } while(rs<=s) { if(h<=m) h=6; else h=h-d; c++; rs=rs+h; } printf("%d\n", c-1); return 0; }