P=2L+2W+L

Please check my answer L=P-2w/2

If you are just solving for L it would be


P = 3L + 2W
P-2W = 3L
L = (P - 2W)/3 or P/3 - (2/3)W