its a very easy program, simply sort the vector and then do a linear count.
iter1 = myvector.begin();
while(iter1 is not up to the end)
while(iter1 is not last eliment AND iter1 and iter1+1 same element)
//calculate your count. simple count++ wont work ;) you have to think of this two situate, 112 and 11112 .. notice in first sequence one two 1 and in second sequence 4 1.
Think about it and let me know if you have problem of understanding it.