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