Problem:
Score : 300 points

Problem Statement

You drew lottery N times. In the i-th draw, you got an item of the kind represented by a string S_i.

How many kinds of items did you get?

Constraints

1 \leq N \leq 2\times 10^5

S_i consists of lowercase English letters and has a length between 1 and 10 (inclusive).

Input

Input is given from Standard Input in the following format:

N
S_1
:
S_N

Output

Print the number of kinds of items you got.

Sample Input 1

3
apple
orange
apple

Sample Output 1

2

You got two kinds of items: apple and orange.

Sample Input 2

5
grape
grape
grape
grape
grape

Sample Output 2

1

Sample Input 3

4
aaaa
a
aaa
aa

Sample Output 3

4

Solution in Go (1.14.1) (judge verdict: Wrong Answer)

package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

var sc = bufio.NewScanner(os.Stdin)

func nextInt() int {
	sc.Scan()
	num, err := strconv.Atoi(sc.Text())
	if err != nil {
		panic(err)
	}
	return num
}

func nextString() string {
	sc.Scan()
	return sc.Text()
}

type BinaryNode struct {
	Value string
	Left  *BinaryNode
	Right *BinaryNode
}

type BinaryTree struct {
	Root *BinaryNode
}

func NewBinaryNode(val string) *BinaryNode {
	return &BinaryNode{val, new(BinaryNode), new(BinaryNode)}
}

func (n *BinaryTree) Add(val string) int {
	count := 0
	if n.Root == nil {
		n.Root = NewBinaryNode(val)
		count++
	} else {
		count += n.Root.Add(val)
	}
	return count
}

func (n *BinaryNode) Add(val string) int {
	if val == n.Value {
		return 0
	}

	if isBigger(n.Value, val) {
		if n.Left != nil {
			n.Left.Add(val)
		} else {
			n.Left = NewBinaryNode(val)
		}
		return 1
	} else {
		if n.Right != nil {
			n.Right.Add(val)
		} else {
			n.Right = NewBinaryNode(val)
		}
		return 1
	}
	return 0
}

func isBigger(str1, str2 string) bool {
	len1 := len(str1)
	len2 := len(str2)
	max := len2
	if len1 < len2 {
		max = len1
	}

	for i := 0; i < max; i++ {
		if str1[i] > str2[i] {
			return true
		}
		if str2[i] < str2[i] {
			return false
		}
	}

	return len1 > len2
}

func main() {
	// sc.Split(bufio.ScanWords)

	n := nextInt()

	bn := new(BinaryTree)
	count := 0

	for i := 0; i < n; i++ {
		str := nextString()
		count += bn.Add(str)
	}

	fmt.Println(count)

}