#include <bits/stdc++.h>
using namespace std;
int x;
string s1, s2;
int main() {
  scanf("%d", &x);
  cin >> s1 >> s2;
  if (s2[0] == 'm') {
    if (x == 30)
      printf("11");
    else if (x == 31)
      printf("7");
    else
      printf("12");
  } else {
    if (x == 6 || x == 5)
      printf("53");
    else
      printf("52");
  }
  return 0;
}
