refine javascript to count SNS num