public static void main ( String [ ] args ) {
  Scanner sc = new Scanner ( System . in ) ;
  int n = sc . nextInt ( ) ;
  String s1 = sc . next ( ) ;
  String s2 = sc . next ( ) ;
  if ( s2 . charAt ( 0 ) == 'w' ) {
    int x = 0 ;
    int current = 5 ;
    for ( int i = 0 ;
    i < 366 ;
    i ++ ) {
      if ( current == n ) {
        x ++ ;
      }
      current ++ ;
      if ( current > 7 ) {
        current = 1 ;
      }
    }
    System . out . println ( x ) ;
    return ;
  }
  else {
    switch ( n ) {
      case 30 : System . out . println ( 11 ) ;
      break ;
      case 31 : System . out . println ( 7 ) ;
      break ;
      default : System . out . println ( 12 ) ;
      break ;
    }
  }
}

public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; String s1 = sc . next ( ) ; String s2 = sc . next ( ) ; if ( s2 . charAt ( 0 ) == ' w ' ) { int x = 0 ; int current = 5 ; for ( int i = 0 ; i < 366 ; i ++ ) { if ( current == n ) { x ++ ; } current ++ ; if ( current > 7 ) { current = 1 ; } } System . out . println ( x ) ; return ; } else { switch ( n ) { case 30 : System . out . println ( 11 ) ; break ; case 31 : System . out . println ( 7 ) ; break ; default : System . out . println ( 12 ) ; break ; } } }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (array_type element: (type_identifier) dimensions: (dimensions)) name: (identifier))) body: (block (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (object_creation_expression type: (type_identifier) arguments: (argument_list (field_access object: (identifier) field: (identifier)))))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))) (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))) (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))) (if_statement condition: (parenthesized_expression (binary_expression left: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (decimal_integer_literal))) right: (character_literal))) consequence: (block (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) condition: (binary_expression left: (identifier) right: (decimal_integer_literal)) update: (update_expression (identifier)) body: (block (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) consequence: (block (expression_statement (update_expression (identifier))))) (expression_statement (update_expression (identifier))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal))) consequence: (block (expression_statement (assignment_expression left: (identifier) right: (decimal_integer_literal))))))) (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (identifier)))) (return_statement)) alternative: (block (switch_expression condition: (parenthesized_expression (identifier)) body: (switch_block (switch_block_statement_group (switch_label (decimal_integer_literal)) (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (decimal_integer_literal)))) (break_statement)) (switch_block_statement_group (switch_label (decimal_integer_literal)) (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (decimal_integer_literal)))) (break_statement)) (switch_block_statement_group (switch_label) (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (decimal_integer_literal)))) (break_statement))))))))