#include <bits/stdc++.h>
int main() {
  std::ios::sync_with_stdio(false);
  std::vector<int> mo(32, 12), we(8, 52);
  mo[30] = 11;
  mo[31] = 7;
  we[5] = we[6] = 53;
  int n;
  std::cin >> n;
  char s[10];
  std::cin >> s >> s;
  if (s[0] == 'w')
    std::cout << we[n] << std::endl;
  else
    std::cout << mo[n] << std::endl;
  return 0;
}
