Paco had w salty cookies and x sweet cookies. He ate y sweet cookies and z salty cookies. How many salty cookies did Paco have left?
et's denote the number of salty cookies that Paco had at the beginning as s, the number of sweet cookies that Paco had at the beginning as c, the number of sweet cookies that Paco ate as y, the number of salty cookies that Paco ate as z. Then we have the following system of equations:

s+c=w+x
y+z=x+s
s-z=?

solve the system:

s+c=w+x
s+y=x+z
s=w+x-c-y+z
s=w+x-(w+x-s-y)-y+z
s=s
s=w+x-c-y+z