#include <bits/stdc++.h>
using namespace std;
int main() {
  int ans;
  string s;
  getline(cin, s);
  if (s[5] == 'm' || s[6] == 'm') {
    string s1;
    s1 += s[0];
    s1 += s[1];
    if (s1 == "31")
      ans = 7;
    else if (s1 == "30")
      ans = 11;
    else
      ans = 12;
  } else {
    if (s[0] == '5' || s[0] == '6')
      ans = 53;
    else
      ans = 52;
  }
  cout << ans << endl;
}
