Unpaired Majorana fermions in a layered topological superconductor