Let
b = number of bills received
a = number of ads received
l = number of letters received
m = number of magazines received
The Moore family received 27 pieces of mail, consisting of bills, ads, letters, and magazines:
b + a + l + m = 27
They received 3 more ads than letters:
a = l + 3
The same number of bills as letters:
b = l
5 more magazines than ads:
m = a + 5
Plug l = b into a = l + 3, we get: a = b + 3
Plug a = b + 3 into m = a + 5, we get: m = b + 3 + 5 that is m = b + 8
Now plug l = b, a = b + 3 and m = b + 8 into b + a + l + m = 27:
collect like terms
Hence the Moore family received 4 letters