You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

17 lines
337 B

#include <bits/stdc++.h>
using namespace std;
int main() {
//cin读入优化
std::ios::sync_with_stdio(false);
int n;
char jiaji;
int sum = 8;
cin >> n >> jiaji;
if (n >= 1000) sum += ceil(1.0 * (n - 1000) / 500) * 4;
if (jiaji == 'y') sum += 5;
cout << sum << endl;
return 0;
}