If you have GNU find,
find . -mindepth 1 -maxdepth 1 -printf x | wc -c
performs about the same and includes dotfiles (not "." or "..", though) in the count.