A String Game

2

1 votes
Easy
Problem

Bob is a string freak. He has got sequences of words to experiment with. If in a sequence, two same words come together then they’ll destroy each other. He wants to know the number of words left in the sequence after this pairwise destruction.

INPUT
The input file will consist of several lines of several words. Words are contiguous stretches of printable characters delimited by white space.

OUTPUT
Print the number of words left per sequence for each line of input.

CONSTRAINTS
Number of lines in the input and number or words per sequence would not exceed 1000 each.

Time Limit: 1
Memory Limit: 256
Source Limit:
Editor Image

?