#include <bits/stdc++.h>
using namespace std;
long long int mod = 1000000007;
long long int INF64 = mod * mod + 1;
void solve() {
  long long int n;
  cin >> n;
  string s;
  cin >> s;
  tuple<long long int, long long int, long long int> ans = {0, 1, 1};
  for (long long int i = 0; i < n; i++) {
    for (long long int j = i; j < n; j++) {
      swap(s[i], s[j]);
      long long int bal = 0;
      pair<long long int, long long int> curr = {INF64, 0};
      for (auto it : s) {
        if (it == '(')
          bal++;
        else
          bal--;
        if (curr.first > bal) curr = {bal, 0};
        if (curr.first == bal) curr.second++;
      }
      if (bal != 0) {
        cout << 0 << '\n' << "1 1" << '\n';
        return;
      }
      if (get<0>(ans) < curr.second) ans = {curr.second, i + 1, j + 1};
      swap(s[i], s[j]);
    }
  }
  cout << get<0>(ans) << '\n' << get<1>(ans) << " " << get<2>(ans) << '\n';
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long int T = 1;
  for (long long int i = 1; i <= T; i++) {
    solve();
  }
  cerr << "Time : " << 1000 * ((double)clock()) / (double)CLOCKS_PER_SEC
       << "ms\n";
}
