`words.count` would be the more idiomatic way of achieving this.