#include <bits/stdc++.h>
using namespace std;
string s;
int n;
int main() {
  getline(cin, s);
  (s[8] == 'k')      ? n = s[0] - 48
  : (s.size() == 11) ? n = (s[0] - 48) * 10 + s[1] - 48
                     : n = s[0] - 48;
  if (s[8] == 'k') {
    if (n == 5 || n == 6)
      cout << 53;
    else
      cout << 52;
  } else {
    if (n == 30)
      cout << 11;
    else if (n == 31)
      cout << 7;
    else
      cout << 12;
  }
}
