import java.io.BufferedReader; import java.io.InputStreamReader; import java.io.IOException; public class Main{ public static void main(String[] args)throws IOException{ BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); int n = Integer.parseInt(in.readLine()); String str = null;
while((str = in.readLine()) != null){
String[] s = str.split(" ");
int sum = 0;
for(String ch : s){
sum += Integer.parseInt(ch);
}
System.out.println(sum - n);
}
}
}