Let a=number of ones, b=number of fives, c=number of tens and d the number of twenties.
a+b+c+d=25; a=2c; b=a-2. Therefore b=2c-2 and 2c+2c-2+c+d=25. So 5c+d=27, and d=27-5c.
So the value of a ones is $a, b fives is $5b, c tens is $10c and d twenties $20d.
Also, a+5b+10c+20d=140, therefore 2c+10c-10+10c+20d=140, 22c+20d=150 (or 11c+10d=75).
We know d in terms of c: 11c+10(27-5c)=75; 11c-50c+270=75, 39c=195, c=5.
So a=10, b=2c-2=8, d=27-5c=2. 25 bills altogether. There are 10 ones, 8 fives, 5 tens and 2 twenties. The value is 10+40+50+40=$140.