#include <bits/stdc++.h>
using namespace std;
int main() {
  int x1;
  char x2[10], x3[10];
  while (cin >> x1 >> x2 >> x3) {
    if (x3[0] == 'w') {
      if (x1 == 5 || x1 == 6)
        cout << 53 << endl;
      else
        cout << 52 << endl;
    } else {
      if (x1 == 30) {
        cout << 11 << endl;
      } else if (x1 == 31)
        cout << 7 << endl;
      else
        cout << 12 << endl;
    }
  }
  return 0;
}
