Easy Parenthesis

Let there be a parenthesis sequence string SSS. This sequence is not guaranteed to be balanced. Your task is to make SSS balanced in a minimum number of steps. In each step, you can perform F(S)F(S)F(S) or G(S)G(S)G(S) on the given sequence SSS.


This is a companion discussion topic for the original entry at https://toph.co/p/easy-parenthesis