A = number of $1 bill
B = number of $5 bill
A + B = 1919
A*$1 + B*$5 = 5959
so
A + B = 1919
A + 5B = 5959
Substract both equation
A + 5B - (A + B) = 5959 - 1919
4B = 4040
B = 1010
And
A = 1919 - B = 1919 - 1010 = 909
A = 909
Check the result :
A*$1 + B*$5 = 909 + 1010*5 = 909 + 5050 = 5959