#include <bits/stdc++.h>
using namespace std;
long long i, j = 0, k = 0, l = 0, m = 0, n, t = 0, sum = 0, r = 0, q = 0, p = 0,
             z = 0;
int a[2000005];
vector<int> v;
int main() {
  ios_base::sync_with_stdio(false);
  string s, f, g;
  cin >> m >> f >> g;
  n = g.size();
  if (g[n - 1] == 'k')
    t = 0;
  else
    t = 1;
  if (t == 1) {
    if (m < 30)
      cout << "12";
    else if (m == 31)
      cout << "7";
    else
      cout << "11";
  } else {
    if (m == 5 || m == 6)
      cout << "53";
    else
      cout << "52";
  }
  return 0;
}
