a string valid parenthesis stre denote VPS meet followingit string single character equal it write AB a concatenate B A b vps orit write a a VPSWe similarly define nesting depth depths VPS S followsdepth 0depthC 0 c string single character equal depthA B maxdeptha depthB a b vpssdepth a 1 depthA A VPSFor example VPSs nesting depth 0 1 2 VPSsGiven VPS represent string s return nesting depth s example 1input s 123841output 3explanation Digit 8 inside 3 nest parenthese stringexample 2input s 123output 3 Constraints1 slength 100s consist digit 09 character it guarantee parenthese expression s vps