static int countOperations ( int n ) {
  int i = 2 ;
  while ( ( i * i ) < n && ( n % i ) > 0 ) i += 1 ;
  if ( ( i * i ) > n ) i = n ;
  return ( 1 + ( n - i ) / 2 ) ;
}

static int countOperations ( int n ) { int i = 2 ; while ( ( i * i ) < n && ( n % i ) > 0 ) i += 1 ; if ( ( i * i ) > n ) i = n ; return ( 1 + ( n - i ) / 2 ) ; }
(method_declaration (modifiers) type: (integral_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (integral_type) name: (identifier))) body: (block (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) (while_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) right: (identifier)) right: (binary_expression left: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) right: (decimal_integer_literal)))) body: (expression_statement (assignment_expression left: (identifier) right: (decimal_integer_literal)))) (if_statement condition: (parenthesized_expression (binary_expression left: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) right: (identifier))) consequence: (expression_statement (assignment_expression left: (identifier) right: (identifier)))) (return_statement (parenthesized_expression (binary_expression left: (decimal_integer_literal) right: (binary_expression left: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) right: (decimal_integer_literal)))))))