Greatest common factor of three or four numbers