Not able to understand how to remove the punctuations

how are we getting the answer as 5 here?