To form a triangle with vertices of the octagon, we must choose 3 vertices such that only one side of the triangle is common with the octagon. The formula for the number of triangles with one side common to the octagon is given by choosing 2 vertices and the third one from the remaining vertices. Thus, the correct answer is 32.