#include <bits/stdc++.h>
int main() {
  int sum, c, b;
  char a[100], ch;
  gets(a);
  if (a[5] == 'w') {
    if (a[0] == '1' || a[0] == '2' || a[0] == '3' || a[0] == '4' || a[0] == '7')
      printf("52\n");
    else
      printf("53\n");
  } else {
    if (a[1] >= '0' && a[1] <= '9') {
      c = (a[0] - '0') * 10;
      b = a[1] - '0';
      sum = c + b;
    } else {
      sum = a[0] - '0';
    }
    if (sum <= 29)
      printf("12\n");
    else if (sum == 30)
      printf("11\n");
    else
      printf("7\n");
  }
  return 0;
}
