public static void main ( String [ ] args ) throws IOException {
  n = nextInt ( ) ;
  k = nextInt ( ) ;
  t = nextInt ( ) ;
  if ( t <= k ) debug ( "" + t ) ;
  else if ( t <= n ) debug ( "" + k ) ;
  else debug ( "" + ( n + k - t ) ) ;
}

public static void main ( String [ ] args ) throws IOException { n = nextInt ( ) ; k = nextInt ( ) ; t = nextInt ( ) ; if ( t <= k ) debug ( " " + t ) ; else if ( t <= n ) debug ( " " + k ) ; else debug ( " " + ( n + k - t ) ) ; }
(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 (expression_statement (assignment_expression left: (identifier) right: (method_invocation name: (identifier) arguments: (argument_list)))) (expression_statement (assignment_expression left: (identifier) right: (method_invocation name: (identifier) arguments: (argument_list)))) (expression_statement (assignment_expression left: (identifier) right: (method_invocation name: (identifier) arguments: (argument_list)))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) consequence: (expression_statement (method_invocation name: (identifier) arguments: (argument_list (binary_expression left: (string_literal) right: (identifier))))) alternative: (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) consequence: (expression_statement (method_invocation name: (identifier) arguments: (argument_list (binary_expression left: (string_literal) right: (identifier))))) alternative: (expression_statement (method_invocation name: (identifier) arguments: (argument_list (binary_expression left: (string_literal) right: (parenthesized_expression (binary_expression left: (binary_expression left: (identifier) right: (identifier)) right: (identifier)))))))))))