private static void jam ( String inFile , String outFile ) throws Exception {
  BufferedReader brIn = new BufferedReader ( new FileReader ( inFile ) ) ;
  BufferedWriter bwOut = new BufferedWriter ( new FileWriter ( outFile ) ) ;
  String sLine ;
  int ca = 1 ;
  brIn . readLine ( ) ;
  int [ ] starts = new int [ 1000000 ] ;
  int [ ] ends = new int [ 1000000 ] ;
  while ( ( sLine = brIn . readLine ( ) ) != null ) {
    String [ ] fields = sLine . split ( " " ) ;
    if ( fields . length != 2 ) {
      System . out . println ( "skipping mis-parse: " + sLine ) ;
      continue ;
    }
    String s = fields [ 0 ] ;
    int n = Integer . parseInt ( fields [ 1 ] ) ;
    int numSets = 0 ;
    int seqNum = 0 ;
    for ( int i = 0 ;
    i < s . length ( ) ;
    i ++ ) {
      char c = s . charAt ( i ) ;
      if ( c != 'a' && c != 'e' && c != 'i' && c != 'o' && c != 'u' ) {
        seqNum ++ ;
        if ( seqNum >= n ) {
          starts [ numSets ] = i + 1 - n ;
          ends [ numSets ] = i + 1 ;
          numSets ++ ;
        }
      }
      else {
        seqNum = 0 ;
      }
    }
    int lastStart = - 1 ;
    long sum = 0 ;
    for ( int i = 0 ;
    i < numSets ;
    i ++ ) {
      int choicesLeft = starts [ i ] - lastStart ;
      int choicesRight = 1 + s . length ( ) - ends [ i ] ;
      sum += ( long ) choicesLeft * ( long ) choicesRight ;
      lastStart = starts [ i ] ;
    }
    String msg = "" + sum ;
    System . out . println ( "" + s . length ( ) ) ;
    bwOut . write ( "Case #" + ca + ": " + msg + "\r\n" ) ;
    ca ++ ;
  }
  brIn . close ( ) ;
  bwOut . close ( ) ;
}

private static void jam ( String inFile , String outFile ) throws Exception { BufferedReader brIn = new BufferedReader ( new FileReader ( inFile ) ) ; BufferedWriter bwOut = new BufferedWriter ( new FileWriter ( outFile ) ) ; String sLine ; int ca = 1 ; brIn . readLine ( ) ; int [ ] starts = new int [ 1000000 ] ; int [ ] ends = new int [ 1000000 ] ; while ( ( sLine = brIn . readLine ( ) ) != null ) { String [ ] fields = sLine . split ( " ▁ " ) ; if ( fields . length != 2 ) { System . out . println ( " skipping ▁ mis - parse : ▁ " + sLine ) ; continue ; } String s = fields [ 0 ] ; int n = Integer . parseInt ( fields [ 1 ] ) ; int numSets = 0 ; int seqNum = 0 ; for ( int i = 0 ; i < s . length ( ) ; i ++ ) { char c = s . charAt ( i ) ; if ( c != ' a ' && c != ' e ' && c != ' i ' && c != ' o ' && c != ' u ' ) { seqNum ++ ; if ( seqNum >= n ) { starts [ numSets ] = i + 1 - n ; ends [ numSets ] = i + 1 ; numSets ++ ; } } else { seqNum = 0 ; } } int lastStart = - 1 ; long sum = 0 ; for ( int i = 0 ; i < numSets ; i ++ ) { int choicesLeft = starts [ i ] - lastStart ; int choicesRight = 1 + s . length ( ) - ends [ i ] ; sum += ( long ) choicesLeft * ( long ) choicesRight ; lastStart = starts [ i ] ; } String msg = " " + sum ; System . out . println ( " " + s . length ( ) ) ; bwOut . write ( " Case ▁ # " + ca + " : ▁ " + msg + " \r \n " ) ; ca ++ ; } brIn . close ( ) ; bwOut . close ( ) ; }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (type_identifier) name: (identifier)) (formal_parameter type: (type_identifier) name: (identifier))) (throws (type_identifier)) body: (block (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (object_creation_expression type: (type_identifier) arguments: (argument_list (object_creation_expression type: (type_identifier) arguments: (argument_list (identifier))))))) (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (object_creation_expression type: (type_identifier) arguments: (argument_list (object_creation_expression type: (type_identifier) arguments: (argument_list (identifier))))))) (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list))) (local_variable_declaration type: (array_type element: (integral_type) dimensions: (dimensions)) declarator: (variable_declarator name: (identifier) value: (array_creation_expression type: (integral_type) dimensions: (dimensions_expr (decimal_integer_literal))))) (local_variable_declaration type: (array_type element: (integral_type) dimensions: (dimensions)) declarator: (variable_declarator name: (identifier) value: (array_creation_expression type: (integral_type) dimensions: (dimensions_expr (decimal_integer_literal))))) (while_statement condition: (parenthesized_expression (binary_expression left: (parenthesized_expression (assignment_expression left: (identifier) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))) right: (null_literal))) body: (block (local_variable_declaration type: (array_type element: (type_identifier) dimensions: (dimensions)) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (string_literal))))) (if_statement condition: (parenthesized_expression (binary_expression left: (field_access object: (identifier) field: (identifier)) right: (decimal_integer_literal))) consequence: (block (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (binary_expression left: (string_literal) right: (identifier))))) (continue_statement))) (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (array_access array: (identifier) index: (decimal_integer_literal)))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (array_access array: (identifier) index: (decimal_integer_literal)))))) (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: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list))) update: (update_expression (identifier)) body: (block (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier))))) (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (binary_expression left: (binary_expression left: (binary_expression left: (identifier) right: (character_literal)) right: (binary_expression left: (identifier) right: (character_literal))) right: (binary_expression left: (identifier) right: (character_literal))) right: (binary_expression left: (identifier) right: (character_literal))) right: (binary_expression left: (identifier) right: (character_literal)))) consequence: (block (expression_statement (update_expression (identifier))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) consequence: (block (expression_statement (assignment_expression left: (array_access array: (identifier) index: (identifier)) right: (binary_expression left: (binary_expression left: (identifier) right: (decimal_integer_literal)) right: (identifier)))) (expression_statement (assignment_expression left: (array_access array: (identifier) index: (identifier)) right: (binary_expression left: (identifier) right: (decimal_integer_literal)))) (expression_statement (update_expression (identifier)))))) alternative: (block (expression_statement (assignment_expression left: (identifier) right: (decimal_integer_literal))))))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (unary_expression operand: (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: (identifier)) update: (update_expression (identifier)) body: (block (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (array_access array: (identifier) index: (identifier)) right: (identifier)))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (binary_expression left: (decimal_integer_literal) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list))) right: (array_access array: (identifier) index: (identifier))))) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (cast_expression type: (integral_type) value: (identifier)) right: (cast_expression type: (integral_type) value: (identifier))))) (expression_statement (assignment_expression left: (identifier) right: (array_access array: (identifier) index: (identifier)))))) (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (string_literal) right: (identifier)))) (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (binary_expression left: (string_literal) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (binary_expression left: (binary_expression left: (binary_expression left: (binary_expression left: (string_literal) right: (identifier)) right: (string_literal)) right: (identifier)) right: (string_literal))))) (expression_statement (update_expression (identifier))))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))))