python counting problem