Peter bought 32 chocolate bars at 4 for $3. He ate two of them and sold the rest at 3 for $4. How much money did he earn?

cost: 32 * 3/4 = 24

income: 30 * 4/3 = 40
so, ...