Exactly One Subject

0.5s 256M

After the midterm, a teacher is tallying the class's English and Math results: \(E\) students passed English, \(M\) students passed Math, and \(B\) of them passed both subjects.

The teacher wants to know how many students passed exactly one of the two subjects, that is, the number of students who passed English but not Math, plus the number who passed Math but not English. Write a program to work it out.

Input

The input contains one line with three integers \(E\), \(M\) and \(B\), separated by spaces: the number of students who passed English, who passed Math, and who passed both.

Constraints

  • \(0 \le B \le E \le 1000\)
  • \(0 \le B \le M \le 1000\)

Output

Output one integer: the number of students who passed exactly one subject.

Sample Input 1

15 20 8

Sample Output 1

19

Sample Input 2

6 10 0

Sample Output 2

16

Sample Input 3

9 9 9

Sample Output 3

0

Sample Explanation

Try to work out why Sample 1 gives 19 before opening this

Among the \(15\) students who passed English, \(8\) also passed Math, so \(15 - 8 = 7\) students passed only English. Likewise, \(20 - 8 = 12\) students passed only Math. Together that is \(7 + 12 = 19\) students.

In Sample 3, all \(9\) students passed both subjects, so nobody passed exactly one, and the answer is \(0\).

Problem page help

Keyboard shortcuts

Main features

  • Sample tests — Runs the sample cases bundled with the problem and auto-compares against the expected output.
  • Custom test — Run your code with your own stdin. Optionally tick the "Compare with expected (diff)" box to verify against expected output line-by-line.
  • Template — Paste the default code template you set on your profile page.
  • Collab — Edit this problem together with classmates in real time.
  • Auto-draft — Editor contents auto-save to your browser every 1.5 seconds (per account / problem / language).
  • Submit — Send your code to the judge for grading; returns AC / WA / TLE etc.

Limits

  • Source code: at most 65,536 characters
  • Custom test stdin and expected output: at most 1 MB each (≈1 million characters)
  • Custom test: about 1 request per 3 s per user (sample test: 1 per 1 s)
  • Custom test has a 15 second wall-clock cap; sample tests use the problem time limit, the same as the official judge
  • Interactive problems do not offer custom test (cannot simulate interaction with the judge).
  • Submitting has no rate limit, but rapid repeated submissions on the same problem are treated as score farming.