A bakery sells bags of flour weighing 2 kg each. If each bag costs $3.50 and a customer buys 5 bags, how much do they pay in total? Additionally, if the bakery gives a discount of $1 for every 5 bags purchased, what is the final amount the customer pays? Let's think step by step and output the final answer within \boxed{}.
user