Magician Raphael
Limits: 2 sec., 512 MiB
This statement was translated automatically from Ukrainian.
Raphael wants to show a card trick. He has a deck consisting of \(n\) black and \(n\) red cards.
He gave Leonardo the deck to shuffle. After that, Leonardo divided the deck into two equal halves.
Raphael counted the number of black cards in the first half — there were \(m\) of them. After that, Raphael easily said how many red cards are in the second half.
Can you also pull off such a trick and say how many red cards are in the second half?
Input
Two integers \(n\) and \(m\) are given in a single line — the number of cards of each color in Raphael’s deck and the number of black cards in the first half.
Output
Print a single integer in a single line — the number of red cards in the second half.
Constraints
\(1 \le m \le n \le 100\).
Samples
| Input (stdin) | Output (stdout) |
|---|---|
| 7 4 | 4 |
Submit a solution
| Element Type | Created | Who | Problem | Compiler | Result | Time (sec.) | Memory (MiB) | # | Actions |
|---|
| Element Type | Created | Who | Problem | Compiler | Result | Time (sec.) | Memory (MiB) | # | Actions |
|---|