Simple foreground cleaning algorithm for detecting primordial B-mode polarization of the cosmic microwave background