Filter using flat map.