#include <bits/stdc++.h>
int main() {
  char dummy[3], s[6];
  int x;
  scanf("%d %s %s", &x, dummy, s);
  if (s[0] == 'm') {
    if (x <= 29)
      printf("12\n");
    else if (x == 30)
      printf("11\n");
    else
      printf("7\n");
  } else {
    if (x == 5 || x == 6)
      printf("53\n");
    else
      printf("52\n");
  }
  return 0;
}
