#include <bits/stdc++.h>
using namespace std;
int n;
string s;
int main() {
  cin >> n;
  cin >> s;
  cin >> s;
  if (s[0] == 'w') {
    if (n == 5)
      cout << 53;
    else if (n == 6)
      cout << 53;
    else
      cout << 52;
  } else {
    if (n == 31)
      cout << 7;
    else if (n == 30)
      cout << 11;
    else
      cout << 12;
  }
}
