Prevalence of cognitive and functional impairment in a community sample in Ribeirão Preto, Brazil