Problem A

Statement
Copy Copied
Description:
Sereja and his friends went to a picnic. The guys had n soda bottles just for it. Sereja forgot the bottle opener as usual, so the guys had to come up with another way to open bottles.

Sereja knows that the i-th bottle is from brand ai, besides, you can use it to open other bottles of brand bi. You can use one bottle to open multiple other bottles. Sereja can open bottle with opened bottle or closed bottle.

Knowing this, Sereja wants to find out the number of bottles they've got that they won't be able to open in any way. Help him and find this number.

Input Format:
The first line contains integer n (1 ≤ n ≤ 100) — the number of bottles. The next n lines contain the bottles' description. The i-th line contains two integers ai, bi (1 ≤ ai, bi ≤ 1000) — the description of the i-th bottle.

Output Format:
In a single line print a single integer — the answer to the problem.

Note:
None

Submissions

IDLanguageExit CodeTimestampCodeStdoutStderrRetry
5258 go 1 2026-03-13T05:44:38.366414Z View View View Retry

Evaluations

Eval IDRun IDProviderModelLangSuccessTimestampPromptResponseStdoutStderrRetry
2327 20260313-045616 openai gpt-5.4 go false 2026-03-13T05:03:38.380763Z View View View View Retry
1526 20260305-112749 openai gpt-5 go true 2026-03-05T11:33:59.378822Z View View View View Retry