finding size = length of new string S '
for ( var i = 0 ; i < N ; ++ i ) { if ( Number . isInteger ( parseInt ( S [ i ] ) ) ) size = size * ( S [ i ] . charCodeAt ( 0 ) - ' ' . charCodeAt ( 0 ) ) ; else size += 1 ; }