In a four digit number, the sum of the first two digits is equal to that of the last two digits. The sum of the first and last digits is equal to the third digit. Finally, the sum of the second and fourth digits is twice the sum of the other two digits. What is the third digit of the number?