Anisha and Dil go out for dinner and spend $31 before tax. The final bill has 8.875% tax added, and they choose to leave a 18% tip, before tax. How much did they pay for lunch in total?