It's fine. The third line could also be "my fifth".
Is the following microdialogue natural? If not, could you change it to sound natural?
S1: Anna, I wonder, what year are you in at university?
S2: I’m in my third year, and you?
S1: The fifth.
S2: I see.
If I were a native speaker of English, I would never shut up. :-)
I am rather fond of the lovely word "microdialogue". It made me think of a conversation between two tiny-weeny people!
Remember - if you don't use correct capitalisation, punctuation and spacing, anything you write will be incorrect.
I wouldn't put the comma after wonder.
If it were 'I wonder what year you are in at university', I wouldn't use the comma there, either.