AGPC01C – Count The Players Solution

0
10
SPOJ Solution

AGPC01C Statement

At AIUB there are N students. Among them C students like to play cricket, F students like to play football, and T students like to play tennis. Among these students some (CF) like both cricket and football, some students (CT) like both cricket and tennis, few others (FT) like both football and Tennis and there are few students (CFT) who like all the sports cricket, football and tennis. Now your task is to find the number of students who do not play any of them at all.

Input

First line of the input contains eight integers N C F T CF CT FT CFT. The values will be greater equal 0 and less equal 100 (N >= C+F+T).

Output

Output one line containing an integer, the number of students who do not play any sports at all. See Sample input output for clarification.

AGPC01C Solution

You also like to see:

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.