The main reason people do it is because if a page fell out somehow, then they can still mark it, while if you dont write your number theres nothing they can do.
The chances of a page falling out are pretty slim, so I wouldnt worry if I were you.
You wont lose marks.
How'd you find the exam btw?