To find the average number of customers for dinner, use the simple ratio of 5 lunch customers for every 8 dinner customers.
Because there are 40 lunch customers, this is eight groups of five lunch customers. This means you will need 8 groups of 8 dinner customers to make it equivalent.