A signboard has red, yellow, and green flashing lights. The red, yellow, and green lights flash every 3 seconds, 4 seconds, and 8 seconds, respectively. At time 0 seconds, the red, yellow, and green lights flash simultaneously. If at time seconds, the third occurrence of only the red and yellow lights flashing together happens, find the value of .