Joe ordered a large cake for his brothers. He gave 1 out of 12 of the cake to David, 5 out of 12 of the cake to John, and 2 out of 12 of the cake to Ali. He ate the remaining cake himself. What fraction of the whole cake did Joe eat?