#include <bits/stdc++.h>
using namespace std;
const int maxn = 6e5 + 7;
const int mod = 1e9 + 7;
string mp;
int a[maxn], b[maxn], sum[maxn];
set<int> h[3];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int t = 1;
  while (t--) {
    int n;
    cin >> n;
    cin >> mp;
    mp = "%" + mp;
    int minn = 0, ans = 0, l = 1, r = 1, p, q, re;
    for (int i = 1; i <= n; i++) {
      if (mp[i] == '(') {
        a[i] = a[n + i] = 1;
      } else
        a[i] = a[n + i] = -1;
    }
    for (int i = 1; i <= 2 * n; i++) {
      sum[i] = sum[i - 1] + a[i];
    }
    if (sum[n] != 0) {
      cout << "0\n1 1\n";
      return 0;
    }
    for (int i = 1; i <= n; i++) {
      minn = min(minn, sum[i]);
    }
    for (int i = 1; i <= n; i++) {
      ans += (sum[i] == minn);
    }
    for (int i = 2 * n; i > 0; i--) {
      if (sum[i] - minn <= 2) {
        h[sum[i] - minn].insert(i);
        b[i] = h[sum[i] - minn].size();
      }
    }
    p = ans;
    for (int i = n; i > 0; i--) {
      if (a[i + 1] == -1) {
        set<int>::iterator it;
        it = h[0].upper_bound(n + i);
        q = *(--it);
        it = h[1].upper_bound(n + i);
        re = b[q + 1];
        if (it != h[1].end()) {
          re -= b[*it];
        }
        if (re > ans) {
          ans = re;
          l = i % n + 1;
          r = q % n + 1;
        }
        it = h[1].upper_bound(i + n);
        q = *(--it);
        if (q != i + n) {
          it = h[2].upper_bound(n + i);
          re = p + b[q + 1];
          if (it != h[2].end()) {
            re -= b[*it];
          }
          if (re > ans) {
            ans = re;
            l = i % n + 1;
            r = q % n + 1;
          }
        }
      }
    }
    cout << ans << "\n" << l << " " << r << endl;
  }
  return 0;
}
