import java.util.Scanner;

public class Main {

    public static void main(String[] args) {

    	Scanner parameter = new Scanner(System.in);

        String[] input1 = parameter.nextLine().split(" ");

        Integer limit = Integer.valueOf(input1[0]);

        Integer water1 = Integer.valueOf(input1[1]);

        Integer water2 = Integer.valueOf(input1[2]);

        System.out.println(water1 + water2 < limit ? 0 : water2 + water1 -limit);
    }
} import java.util.Scanner; Scanner java.util public class Main {

    public static void main(String[] args) {

    	Scanner parameter = new Scanner(System.in);

        String[] input1 = parameter.nextLine().split(" ");

        Integer limit = Integer.valueOf(input1[0]);

        Integer water1 = Integer.valueOf(input1[1]);

        Integer water2 = Integer.valueOf(input1[2]);

        System.out.println(water1 + water2 < limit ? 0 : water2 + water1 -limit);
    }
} Main public static void main(String[] args) {

    	Scanner parameter = new Scanner(System.in);

        String[] input1 = parameter.nextLine().split(" ");

        Integer limit = Integer.valueOf(input1[0]);

        Integer water1 = Integer.valueOf(input1[1]);

        Integer water2 = Integer.valueOf(input1[2]);

        System.out.println(water1 + water2 < limit ? 0 : water2 + water1 -limit);
    } main {

    	Scanner parameter = new Scanner(System.in);

        String[] input1 = parameter.nextLine().split(" ");

        Integer limit = Integer.valueOf(input1[0]);

        Integer water1 = Integer.valueOf(input1[1]);

        Integer water2 = Integer.valueOf(input1[2]);

        System.out.println(water1 + water2 < limit ? 0 : water2 + water1 -limit);
    } Scanner parameter = new Scanner(System.in); parameter new Scanner(System.in) String[] input1 = parameter.nextLine().split(" "); input1 parameter.nextLine().split(" ") parameter.nextLine().split parameter.nextLine() parameter.nextLine parameter " " Integer limit = Integer.valueOf(input1[0]); limit Integer.valueOf(input1[0]) Integer.valueOf Integer input1[0] input1 0 Integer water1 = Integer.valueOf(input1[1]); water1 Integer.valueOf(input1[1]) Integer.valueOf Integer input1[1] input1 1 Integer water2 = Integer.valueOf(input1[2]); water2 Integer.valueOf(input1[2]) Integer.valueOf Integer input1[2] input1 2 System.out.println(water1 + water2 < limit ? 0 : water2 + water1 -limit) System.out.println System.out System System.out water1 + water2 < limit ? 0 : water2 + water1 -limit water1 + water2 < limit water1 + water2 water1 water2 limit 0 water2 + water1 -limit water2 + water1 water2 water1 limit String[] args args public class Main {

    public static void main(String[] args) {

    	Scanner parameter = new Scanner(System.in);

        String[] input1 = parameter.nextLine().split(" ");

        Integer limit = Integer.valueOf(input1[0]);

        Integer water1 = Integer.valueOf(input1[1]);

        Integer water2 = Integer.valueOf(input1[2]);

        System.out.println(water1 + water2 < limit ? 0 : water2 + water1 -limit);
    }
} public class Main {

    public static void main(String[] args) {

    	Scanner parameter = new Scanner(System.in);

        String[] input1 = parameter.nextLine().split(" ");

        Integer limit = Integer.valueOf(input1[0]);

        Integer water1 = Integer.valueOf(input1[1]);

        Integer water2 = Integer.valueOf(input1[2]);

        System.out.println(water1 + water2 < limit ? 0 : water2 + water1 -limit);
    }
} Main
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {

    	Scanner parameter = new Scanner(System.in);

        String[] input1 = parameter.nextLine().split(" ");

        Integer limit = Integer.valueOf(input1[0]);

        Integer water1 = Integer.valueOf(input1[1]);

        Integer water2 = Integer.valueOf(input1[2]);

        System.out.println(water1 + water2 < limit ? 0 : water2 + water1 -limit);
    }
}
