#include <bits/stdc++.h>
using namespace std;
const int MAX_N = 1e5 + 10;
int main() {
  string s1, s2, s3;
  cin >> s1 >> s2 >> s3;
  if (s3[0] == 'w') {
    if (s1[0] != '6' && s1[0] != '5')
      cout << "52" << endl;
    else
      cout << "53" << endl;
    return 0;
  } else {
    if (s1[0] == '3') {
      if (s1[1] == '0')
        cout << "11" << endl;
      else if (s1[1] == '1')
        cout << "7" << endl;
      else
        cout << "12" << endl;
    } else
      cout << "12" << endl;
  }
  return 0;
}
