The sum of a and B is 800. Two fifths of B is 50 more than half of A. what is a and B

The sum of a and B is 800. Two fifths of B is 50 more than half of A. what is a and B

Let a and B be x and Y respectively
X+Y=800
Y*2/5-X*1/2=50
1.8Y=900
Y=500
X=800-500=300
A = 300
B = 500