Would it be possible to count the marks in pdf document in order to get the total and to eliminate counting errors?
Not without writing some custom code to handle this.
How would you expect it to work - would you want the code to search through all the comments made on the PDF, extract any numbers in them and add them up?
How would the code distinguish between 'you need to add 2 more examples here' and '2 marks'? Would the code also need to realise that '3 / 5' and '3 out of 5' both mean 3 marks, not 3 marks and 5 marks? Or would it even need to understand that '3 / 5' means a contribution of 0.6 marks to the total mark?
I hope the above doesn't come across too negative, but what you're asking sounds (to me) like quite a hard problem for a computer to solve ...