function main(arg) {
	arg = arg.trim();
	var day = ['MON', 'TUE', 'WED', 'THU', 'FRI', 'SAT', 'SUN'];
  	var out = day.indexOf(arg);
  	switch (out) {
      case 0:
        out = 6;
        break;
      case 1:
        out = 5;
        break;
      case 2:
        out = 4;
        break;
      case 3:
        out = 3;
        break;
      case 4:
        out = 2;
        break;
      case 5:
        out = 1;
        break;
      case 6:
        out = 7;
        break;
	}
  console.log(out)
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));