#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  long long n, i;
  string str, a;
  cin >> n >> a >> str;
  for (i = 0; i < str.length(); i++) {
    if (str[i] == 'w') break;
  }
  if (i == str.length()) {
    if (n <= 29)
      cout << "12\n";
    else if (n == 30)
      cout << "11\n";
    else
      cout << "7\n";
  } else {
    if (n == 5 || n == 6)
      cout << "53\n";
    else
      cout << "52\n";
  }
  return 0;
}
