The formula for perimeter (total length all around sides) for a rectangle is
P(L,w) = 2(L+w)
Assuming the neighbour wants to fence all around each yard, the total fence length is the total of two perimeters, namely
Length of fence
= 2(65+45) + 2(35+45)
=2(110)+2(80)
=220+160
=380 feet.