t与a的差值,就是损失的分数:

import java.util.*;
public class Main {
    public static void main(String[] args) throws Exception{
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt(), t = sc.nextInt(), a = sc.nextInt();
        System.out.println(n - Math.abs(t - a));
    }
}