#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
const int N = 2005;
const int MOD = 1e9 + 7;
int n;
char s[2][10];
int main() {
  while (scanf("%d %s %s", &n, s[0], s[1]) != EOF) {
    if (s[1][0] == 'w') {
      if (n <= 4 || n == 7)
        cout << 52 << endl;
      else
        cout << 53 << endl;
    } else {
      if (n >= 1 && n <= 29) {
        cout << 12 << endl;
      } else if (n == 30) {
        cout << 11 << endl;
      } else
        cout << 7 << endl;
    }
  }
  return 0;
}
