import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String line = scanner.nextLine();
        String[] token = line.split(" ");
        int max1 = Integer.parseInt(token[0]);
        int cur1 = Integer.parseInt(token[1]);
        int cur2 = Integer.parseInt(token[2]);

        int residual;
        if (max1 - cur1 < cur2) {
            residual = cur2 - (max1 - cur1);
        } else {
            residual = 0;
        }

        System.out.println(residual);
    }
} import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String line = scanner.nextLine();
        String[] token = line.split(" ");
        int max1 = Integer.parseInt(token[0]);
        int cur1 = Integer.parseInt(token[1]);
        int cur2 = Integer.parseInt(token[2]);

        int residual;
        if (max1 - cur1 < cur2) {
            residual = cur2 - (max1 - cur1);
        } else {
            residual = 0;
        }

        System.out.println(residual);
    }
} Main public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String line = scanner.nextLine();
        String[] token = line.split(" ");
        int max1 = Integer.parseInt(token[0]);
        int cur1 = Integer.parseInt(token[1]);
        int cur2 = Integer.parseInt(token[2]);

        int residual;
        if (max1 - cur1 < cur2) {
            residual = cur2 - (max1 - cur1);
        } else {
            residual = 0;
        }

        System.out.println(residual);
    } main {
        Scanner scanner = new Scanner(System.in);
        String line = scanner.nextLine();
        String[] token = line.split(" ");
        int max1 = Integer.parseInt(token[0]);
        int cur1 = Integer.parseInt(token[1]);
        int cur2 = Integer.parseInt(token[2]);

        int residual;
        if (max1 - cur1 < cur2) {
            residual = cur2 - (max1 - cur1);
        } else {
            residual = 0;
        }

        System.out.println(residual);
    } Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) String line = scanner.nextLine(); line scanner.nextLine() scanner.nextLine scanner String[] token = line.split(" "); token line.split(" ") line.split line " " int max1 = Integer.parseInt(token[0]); max1 Integer.parseInt(token[0]) Integer.parseInt Integer token[0] token 0 int cur1 = Integer.parseInt(token[1]); cur1 Integer.parseInt(token[1]) Integer.parseInt Integer token[1] token 1 int cur2 = Integer.parseInt(token[2]); cur2 Integer.parseInt(token[2]) Integer.parseInt Integer token[2] token 2 int residual; residual if (max1 - cur1 < cur2) {
            residual = cur2 - (max1 - cur1);
        } else {
            residual = 0;
        } max1 - cur1 < cur2 max1 - cur1 max1 cur1 cur2 {
            residual = cur2 - (max1 - cur1);
        } residual = cur2 - (max1 - cur1) residual cur2 - (max1 - cur1) cur2 (max1 - cur1) max1 cur1 {
            residual = 0;
        } residual = 0 residual 0 System.out.println(residual) System.out.println System.out System System.out residual String[] args args public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String line = scanner.nextLine();
        String[] token = line.split(" ");
        int max1 = Integer.parseInt(token[0]);
        int cur1 = Integer.parseInt(token[1]);
        int cur2 = Integer.parseInt(token[2]);

        int residual;
        if (max1 - cur1 < cur2) {
            residual = cur2 - (max1 - cur1);
        } else {
            residual = 0;
        }

        System.out.println(residual);
    }
} public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String line = scanner.nextLine();
        String[] token = line.split(" ");
        int max1 = Integer.parseInt(token[0]);
        int cur1 = Integer.parseInt(token[1]);
        int cur2 = Integer.parseInt(token[2]);

        int residual;
        if (max1 - cur1 < cur2) {
            residual = cur2 - (max1 - cur1);
        } else {
            residual = 0;
        }

        System.out.println(residual);
    }
} Main
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String line = scanner.nextLine();
        String[] token = line.split(" ");
        int max1 = Integer.parseInt(token[0]);
        int cur1 = Integer.parseInt(token[1]);
        int cur2 = Integer.parseInt(token[2]);

        int residual;
        if (max1 - cur1 < cur2) {
            residual = cur2 - (max1 - cur1);
        } else {
            residual = 0;
        }

        System.out.println(residual);
    }
}