public static void main ( String [ ] args ) throws IOException {
  Scanner in = new Scanner ( new BufferedReader ( new InputStreamReader ( System . in ) ) ) ;
  String str1 = in . next ( ) ;
  String str2 = in . next ( ) ;
  int n1 = str1 . length ( ) , n2 = str2 . length ( ) ;
  int count0 = 0 , count1 = 0 ;
  for ( int x = 0 ;
  x <= n2 - n1 ;
  x ++ ) {
    if ( str2 . charAt ( x ) == '0' ) count0 ++ ;
    else count1 ++ ;
  }
  long ans = 0 ;
  if ( str1 . charAt ( 0 ) == '0' ) ans += count1 ;
  else ans += count0 ;
  for ( int x = n2 - n1 + 1 ;
  x < n2 ;
  x ++ ) {
    char ch = str1 . charAt ( x - n2 + n1 ) ;
    char ch1 = str2 . charAt ( x ) , ch2 = str2 . charAt ( x - n2 + n1 - 1 ) ;
    if ( ch1 == '0' ) count0 ++ ;
    else count1 ++ ;
    if ( ch2 == '0' ) count0 -- ;
    else count1 -- ;
    if ( ch == '0' ) ans += count1 ;
    else ans += count0 ;
  }
  System . out . println ( ans ) ;
}

public static void main ( String [ ] args ) throws IOException { Scanner in = new Scanner ( new BufferedReader ( new InputStreamReader ( System . in ) ) ) ; String str1 = in . next ( ) ; String str2 = in . next ( ) ; int n1 = str1 . length ( ) , n2 = str2 . length ( ) ; int count0 = 0 , count1 = 0 ; for ( int x = 0 ; x <= n2 - n1 ; x ++ ) { if ( str2 . charAt ( x ) == '0' ) count0 ++ ; else count1 ++ ; } long ans = 0 ; if ( str1 . charAt ( 0 ) == '0' ) ans += count1 ; else ans += count0 ; for ( int x = n2 - n1 + 1 ; x < n2 ; x ++ ) { char ch = str1 . charAt ( x - n2 + n1 ) ; char ch1 = str2 . charAt ( x ) , ch2 = str2 . charAt ( x - n2 + n1 - 1 ) ; if ( ch1 == '0' ) count0 ++ ; else count1 ++ ; if ( ch2 == '0' ) count0 -- ; else count1 -- ; if ( ch == '0' ) ans += count1 ; else ans += count0 ; } System . out . println ( ans ) ; }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (array_type element: (type_identifier) dimensions: (dimensions)) 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 (object_creation_expression type: (type_identifier) arguments: (argument_list (field_access object: (identifier) field: (identifier)))))))))) (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)))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list))) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal)) 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: (binary_expression left: (identifier) right: (identifier))) update: (update_expression (identifier)) body: (block (if_statement condition: (parenthesized_expression (binary_expression left: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier))) right: (character_literal))) consequence: (expression_statement (update_expression (identifier))) alternative: (expression_statement (update_expression (identifier)))))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) (if_statement condition: (parenthesized_expression (binary_expression left: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (decimal_integer_literal))) right: (character_literal))) consequence: (expression_statement (assignment_expression left: (identifier) right: (identifier))) alternative: (expression_statement (assignment_expression left: (identifier) right: (identifier)))) (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (binary_expression left: (identifier) right: (identifier)) right: (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: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (binary_expression left: (binary_expression left: (identifier) right: (identifier)) right: (identifier)))))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier)))) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (binary_expression left: (binary_expression left: (binary_expression left: (identifier) right: (identifier)) right: (identifier)) right: (decimal_integer_literal)))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (character_literal))) consequence: (expression_statement (update_expression (identifier))) alternative: (expression_statement (update_expression (identifier)))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (character_literal))) consequence: (expression_statement (update_expression (identifier))) alternative: (expression_statement (update_expression (identifier)))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (character_literal))) consequence: (expression_statement (assignment_expression left: (identifier) right: (identifier))) alternative: (expression_statement (assignment_expression left: (identifier) right: (identifier)))))) (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (identifier))))))