100-MHz optical counter that uses directional coupler switches