#include <bits/stdc++.h>
using namespace std;
int gcd(int a, int b) { return a % b == 0 ? b : gcd(b, a % b); }
const int INF = 1 << 30;
const double eps = 1e-8;
const int row = 3000;
const int cow = 220;
const int MAXN = cow * cow;
int n, m;
char s1[30], s2[30];
int main() {
  int i, j, t;
  scanf("%d%s%s", &n, &s1, &s2);
  if (s2[0] == 'w') {
    if (n == 5 || n == 6)
      printf("53\n");
    else
      printf("52\n");
  } else {
    if (n <= 29) {
      printf("12\n");
    } else if (n == 30) {
      printf("11\n");
    } else {
      printf("7\n");
    }
  }
  return 0;
}
