#include <bits/stdc++.h>
using namespace std;
int cnt[300005][3];
bool arr[300005];
int ans = 1;
pair<int, int> ansat = {1, 1};
void calc(int from, int to) {}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  cin >> n;
  int a = 0;
  for (int i = 1; i <= n; i++) {
    char ch;
    cin >> ch;
    arr[i] = (ch == ')');
    if (ch == '(') {
      a++;
    }
  }
  if (a != n - a) {
    cout << "0\n1 1";
    return 0;
  }
  int mostclosedat = 0;
  int mostclosed = 0;
  int closed = 0;
  vector<int> val(n + 1, 0);
  for (int i = 1; i <= n; i++) {
    if (arr[i]) {
      closed++;
    } else {
      closed--;
    }
    val[i] = closed;
    if (closed > mostclosed) {
      mostclosed = closed;
      mostclosedat = i;
      ans = 1;
    } else if (closed == mostclosed) {
      ans++;
    }
  }
  vector<bool> newarr(n + 1);
  for (int i = 1; i <= n; i++) {
    int ind = (i + mostclosedat);
    if (ind > n) {
      ind -= n;
    }
    newarr[i] = arr[ind];
  }
  for (int i = 1; i <= n; i++) {
    arr[i] = newarr[i];
  }
  closed = 0;
  ans = 0;
  for (int i = 1; i <= n; i++) {
    if (arr[i]) {
      closed++;
    } else {
      closed--;
    }
    val[i] = closed;
    if (closed == 0) {
      ans++;
    }
  }
  for (int i = 1; i <= n; i++) {
    cnt[i][0] = cnt[i - 1][0];
    cnt[i][1] = cnt[i - 1][1];
    cnt[i][2] = cnt[i - 1][2];
    if (val[i] == 0) {
      cnt[i][0]++;
    }
    if (val[i] + 1 == 0) {
      cnt[i][1]++;
    }
    if (val[i] + 2 == 0) {
      cnt[i][2]++;
    }
  }
  int lastpos = -1;
  for (int i = 1; i <= n; i++) {
    if (arr[i]) {
      if (lastpos != -1) {
        int currans = cnt[n][0] + cnt[i - 1][2] - cnt[lastpos - 1][2];
        if (currans > ans) {
          ans = currans;
          ansat = {lastpos, i};
        }
      }
    } else {
      if (lastpos == -1 || val[i - 1] == 0 || val[i - 1] == 0 - 1) {
        lastpos = i;
      }
    }
  }
  lastpos = -1;
  for (int i = 1; i <= n; i++) {
    if (arr[i]) {
      if (lastpos != -1) {
        int currans = cnt[i - 1][1] - cnt[lastpos - 1][1];
        if (currans > ans) {
          ans = currans;
          ansat = {lastpos, i};
        }
      }
    } else {
      if (lastpos == -1 || val[i - 1] == 0) {
        lastpos = i;
      }
    }
  }
  ansat.first += mostclosedat;
  if (ansat.first > n) {
    ansat.first -= n;
  }
  ansat.second += mostclosedat;
  if (ansat.second > n) {
    ansat.second -= n;
  }
  cout << ans << "\n" << ansat.first << " " << ansat.second;
  return 0;
}
