A man was trapped in a room for several weeks. After making lots of attempts finding a way out, he stumbles to a door with a security code. When he reached to the door, he found a note that is the hint as to what is the 4-digit code. After picking up the note, he reads the content of the note. It says that:
" How to open: Let A - B - C - D be the 4 - digit code
A + B = D/2
A + C = D
D - A = C
(B + D) - (C + A) = B
Good Luck ! "
After another hours of thinking, the man got the code and escaped. What is the 4-digit code?