#include <bits/stdc++.h>
using namespace std;
const int N = 3e5 + 1;
string t;
int get(int l, int r) {
  int sum = 0;
  int res = 0;
  for (int i = l + 1; i < r; ++i) {
    sum += ((t[i] == '(') ? 1 : -1);
    res += (!sum);
  }
  return res;
}
int n, p[N], ans1, ans2, pos, mn, ans3, ans4;
string s;
int sum, cnt, mx, mx2;
int main() {
  ios_base ::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> s;
  for (auto to : s) sum += (to == '(' ? 1 : -1);
  if (sum) {
    cout << "0\n1 1";
    return 0;
  }
  for (int i = 0; i < n; ++i) {
    p[i] = ((s[i] == '(') ? 1 : -1);
    if (i) p[i] += p[i - 1];
    if (mn > p[i]) {
      mn = p[i];
      pos = i + 1;
    }
  }
  for (int i = pos; i < n; ++i) t += s[i];
  for (int i = 0; i < pos; ++i) t += s[i];
  int cnt2 = 0;
  for (int l = 0; l < n; ++l) {
    int r = l;
    sum = 1;
    ++cnt;
    while (sum) {
      ++r;
      sum += ((t[r] == '(') ? 1 : -1);
      if (t[r] == '(' && sum == 2) {
        ++cnt2;
        int sum2 = 1, r2 = r;
        while (sum2) {
          ++r2;
          sum2 += ((t[r2] == '(') ? 1 : -1);
        }
        int res = get(r, r2) + 1;
        if (mx < res) {
          mx = res;
          ans1 = r;
          ans2 = r2;
        }
      }
    }
    if (mx2 < cnt2) {
      mx2 = cnt2;
      ans3 = l;
      ans4 = r;
    }
    cnt2 = 0;
    l = r;
  }
  if (cnt + mx < mx2 + 1) {
    cnt = mx2 + 1;
    ans1 = ans3;
    ans2 = ans4;
  } else
    cnt += mx;
  ans1 += pos;
  ans1 %= n;
  ans1 += 1;
  ans2 += pos;
  ans2 %= n;
  ans2 += 1;
  cout << cnt << endl << ans1 << " " << ans2;
  return 0;
}
