Alex programming Valentina toddler daughter got start ask question round bracket parenthesis code he explain bit got give task order finish code timeFor purpose problem consider string consist opening close round bracket character the sequence bracket call correct correct sequence bracket enclose pair open closing bracket concatenation correct sequence bracket for example sequence correct notAlex take piece paper write string s consist bracket ask Valentina count number distinct nonempty substring s correct sequence bracket in word task count number nonempty correct sequence bracket occur stre s substring do not mix subsequenceswhen Valentina finish task Alex notice do not know answer help do not loose face Valentina solve problem