public static void main ( String [ ] $ ) {
  int [ ] name = new int [ 26 ] , kit = new int [ 26 ] ;
  s . next ( ) ;
  s . next ( ) ;
  s . next ( ) . chars ( ) . forEach ( i -> ++ name [ i - 'A' ] ) ;
  s . next ( ) . chars ( ) . forEach ( i -> ++ kit [ i - 'A' ] ) ;
  if ( REPS ( 26 ) . anyMatch ( i -> name [ i ] > 0 && kit [ i ] == 0 ) ) {
    System . out . println ( - 1 ) ;
    return ;
  }
  System . out . println ( REPS ( 26 ) . map ( i -> name [ i ] == 0 ? 0 : ( name [ i ] + kit [ i ] - 1 ) / kit [ i ] ) . max ( ) . getAsInt ( ) ) ;
}

public static void main ( String [ ] $ ) { int [ ] name = new int [ 26 ] , kit = new int [ 26 ] ; s . next ( ) ; s . next ( ) ; s . next ( ) . chars ( ) . forEach ( i -> ++ name [ i - ' A ' ] ) ; s . next ( ) . chars ( ) . forEach ( i -> ++ kit [ i - ' A ' ] ) ; if ( REPS ( 26 ) . anyMatch ( i -> name [ i ] > 0 && kit [ i ] == 0 ) ) { System . out . println ( - 1 ) ; return ; } System . out . println ( REPS ( 26 ) . map ( i -> name [ i ] == 0 ? 0 : ( name [ i ] + kit [ i ] - 1 ) / kit [ i ] ) . max ( ) . getAsInt ( ) ) ; }
(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: (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)))) declarator: (variable_declarator name: (identifier) value: (array_creation_expression type: (integral_type) dimensions: (dimensions_expr (decimal_integer_literal))))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list))) (expression_statement (method_invocation object: (method_invocation object: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)) name: (identifier) arguments: (argument_list)) name: (identifier) arguments: (argument_list (lambda_expression parameters: (identifier) body: (update_expression (array_access array: (identifier) index: (binary_expression left: (identifier) right: (character_literal)))))))) (expression_statement (method_invocation object: (method_invocation object: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)) name: (identifier) arguments: (argument_list)) name: (identifier) arguments: (argument_list (lambda_expression parameters: (identifier) body: (update_expression (array_access array: (identifier) index: (binary_expression left: (identifier) right: (character_literal)))))))) (if_statement condition: (parenthesized_expression (method_invocation object: (method_invocation name: (identifier) arguments: (argument_list (decimal_integer_literal))) name: (identifier) arguments: (argument_list (lambda_expression parameters: (identifier) body: (binary_expression left: (binary_expression left: (array_access array: (identifier) index: (identifier)) right: (decimal_integer_literal)) right: (binary_expression left: (array_access array: (identifier) index: (identifier)) right: (decimal_integer_literal))))))) consequence: (block (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (unary_expression operand: (decimal_integer_literal))))) (return_statement))) (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (method_invocation object: (method_invocation object: (method_invocation object: (method_invocation name: (identifier) arguments: (argument_list (decimal_integer_literal))) name: (identifier) arguments: (argument_list (lambda_expression parameters: (identifier) body: (ternary_expression condition: (binary_expression left: (array_access array: (identifier) index: (identifier)) right: (decimal_integer_literal)) consequence: (decimal_integer_literal) alternative: (binary_expression left: (parenthesized_expression (binary_expression left: (binary_expression left: (array_access array: (identifier) index: (identifier)) right: (array_access array: (identifier) index: (identifier))) right: (decimal_integer_literal))) right: (array_access array: (identifier) index: (identifier))))))) name: (identifier) arguments: (argument_list)) name: (identifier) arguments: (argument_list)))))))