Beth baked chocolate chip cookies, she gave 8 cookies to madex and half of the remaining cookies to John and Joanne. If there were 6 cookies left, how many cookies did Beth bake? Write and solve and equation