Max Transfer Requests

Given n employees each in an initial building and a list of transfer requests, find the maximum number of requests you can fulfill such that each building ends with the same number of employees as it started.

Examples
Input: [5,[[0,1],[1,0],[0,1],[1,2],[2,0],[3,4]]]
Output: 5
Hints

Max Transfer Requests

Given n employees each in an initial building and a list of transfer requests, find the maximum number of requests you can fulfill such that each building ends with the same number of employees as it started.