Count of ' ( ' and ' ) '
var countOpen = 0 ; var i ; for ( i = 0 ; i < s . length ; i ++ ) { if ( s [ i ] == " " ) countOpen ++ ; } var countClose = 0 ; for ( i = 0 ; i < s . length ; i ++ ) { if ( s [ i ] == " " ) countClose ++ ; } ;