When counting the 'Omer, before starting the blessing, a person must know how many days of the 'Omer it is that night. In other words, when counting with other people, he should not say, "let me start the Berakha and I'll hear what the others are saying and say it with them". So the correct way to count the 'Omer is to know before you start the Berakha ([Bracha] blessing), how many days of the 'Omer it is that night that you are counting.
However, what if somebody did start the blessing without knowing and heard what the others were saying and said the same thing? In such a case, after the fact (Bedia'bad), he has, nevertheless, fulfilled his obligation and does not repeat the counting with a blessing, but it is not the ideal way of doing this.
(See Orah Hayyim Haggadah, Hilkhoth Sefirath Ha'Omer, Oth Yod Gheemal)