public static void solve ( ) throws Exception {
  long n = f . nl ( ) ;
  long k = 1 ;
  while ( true ) {
    if ( ( k * ( k + 1 ) ) / 2 >= n ) break ;
    ++ k ;
  }
  long ans = n - ( k * ( k - 1 ) / 2 ) ;
  pn ( ans ) ;
}

public static void solve ( ) throws Exception { long n = f . nl ( ) ; long k = 1 ; while ( true ) { if ( ( k * ( k + 1 ) ) / 2 >= n ) break ; ++ k ; } long ans = n - ( k * ( k - 1 ) / 2 ) ; pn ( ans ) ; }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters) (throws (type_identifier)) body: (block (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: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) (while_statement condition: (parenthesized_expression (true)) body: (block (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (parenthesized_expression (binary_expression left: (identifier) right: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal))))) right: (decimal_integer_literal)) right: (identifier))) consequence: (break_statement)) (expression_statement (update_expression (identifier))))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (identifier) right: (parenthesized_expression (binary_expression left: (binary_expression left: (identifier) right: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal)))) right: (decimal_integer_literal)))))) (expression_statement (method_invocation name: (identifier) arguments: (argument_list (identifier))))))