count total number of badges correctly