// Days (A), by Errichto
#include<bits/stdc++.h>
using namespace std;
int main() {
int x;
scanf("%d", &x);
char sl[15];
scanf("%s", sl);
scanf("%s", sl);
if(sl[0] == 'w') {
if(x == 5 || x == 6) puts("53");
else puts("52");
return 0;
}
if(x <= 29) puts("12");
else if(x <= 30) puts("11");
else puts("7");
return 0;
}
Ly8gRGF5cyAoQSksIGJ5IEVycmljaHRvCiNpbmNsdWRlPGJpdHMvc3RkYysrLmg+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7CgppbnQgbWFpbigpIHsKCWludCB4OwoJc2NhbmYoIiVkIiwgJngpOwoJY2hhciBzbFsxNV07CglzY2FuZigiJXMiLCBzbCk7CglzY2FuZigiJXMiLCBzbCk7CglpZihzbFswXSA9PSAndycpIHsKCQlpZih4ID09IDUgfHwgeCA9PSA2KSBwdXRzKCI1MyIpOwoJCWVsc2UgcHV0cygiNTIiKTsKCQlyZXR1cm4gMDsKCX0KCWlmKHggPD0gMjkpIHB1dHMoIjEyIik7CgllbHNlIGlmKHggPD0gMzApIHB1dHMoIjExIik7CgllbHNlIHB1dHMoIjciKTsKCXJldHVybiAwOwp9Cg==