Hi!
So,
x+y=6 => x=6-y
Now you subtitute x with 6-y in the following equation:
2x+3y=16 => 2*(6-y)+3y=16
2*6-2y+3y=16
12+y=16
y=16-12
y=4
Now, we know that y=4, so we use the first equation to find x:
x=6-y
x=6-4
x=2
We jut found out that x=2 and y=4, so we will be calculating P:
P=5x+6y
P=5*2+6*4
P=10+24
P=34