High redshift galaxies in the ALHAMBRA survey . I. Selection method and number counts based on redshift PDFs