#include <bits/stdc++.h>
using namespace std;
int main() {
  std::ios::sync_with_stdio(false);
  long long x, ans;
  string s;
  cin >> x;
  getline(cin, s);
  long long l = s.length();
  if (s[l - 1] == 'k') {
    if (x == 5 || x == 6)
      ans = 53;
    else
      ans = 52;
  } else {
    if (x <= 29)
      ans = 12;
    else if (x == 30)
      ans = 11;
    else
      ans = 7;
  }
  cout << ans << endl;
  return 0;
}
