#include <bits/stdc++.h>
using namespace std;
const int MAXN = 300500;
int balance[MAXN];
int pref_min[MAXN];
int pref_pre_min[MAXN];
int pref_pre_pre_min[MAXN];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n;
  string s;
  cin >> n >> s;
  int open = 0, close = 0;
  for (int i = 0; i < n; ++i) {
    open += s[i] == '(';
    close += s[i] == ')';
  }
  if (open != close) {
    cout << "0\n1 1";
    return 0;
  }
  int mn = 0;
  for (int i = 0; i < n; ++i) {
    if (i > 0) {
      balance[i] += balance[i - 1];
    }
    if (s[i] == '(') {
      ++balance[i];
    } else {
      --balance[i];
    }
    mn = min(mn, balance[i]);
  }
  vector<int> ind_min;
  vector<int> ind_pre_min_and_min;
  for (int i = 0; i < n; ++i) {
    if (i > 0) {
      pref_min[i] = pref_min[i - 1];
      pref_pre_min[i] = pref_pre_min[i - 1];
      pref_pre_pre_min[i] = pref_pre_pre_min[i - 1];
    }
    if (balance[i] == mn) {
      pref_min[i]++;
      ind_min.push_back(i);
    }
    if (balance[i] == mn + 1) {
      pref_pre_min[i]++;
      ind_pre_min_and_min.push_back(i);
    }
    if (balance[i] == mn + 2) {
      pref_pre_pre_min[i]++;
    }
  }
  int ans = pref_min[n - 1];
  int ansL = 1;
  int ansR = 1;
  {
    int sz = ind_min.size();
    for (int i = 0; i < sz; ++i) {
      int nxt = i + 1;
      if (nxt == sz) {
        nxt = 0;
      }
      int pos1 = ind_min[i] + 1, pos2 = ind_min[nxt];
      int res = 0;
      if (pos1 == n) {
        pos1 = 0;
      }
      if (pos1 > pos2) {
        res += pref_pre_min[n - 1];
      }
      if (pos1 == n) {
        pos1 = 0;
      } else {
        res -= pref_pre_min[pos1 - 1];
      }
      res += pref_pre_min[pos2];
      if (res > ans) {
        ans = res;
        ansL = pos1 + 1;
        ansR = pos2 + 1;
      }
    }
  }
  {
    int sz = ind_pre_min_and_min.size();
    for (int i = 0; i < sz; ++i) {
      int nxt = i + 1;
      if (nxt == sz) {
        nxt = 0;
      }
      int pos1 = ind_pre_min_and_min[i] + 1, pos2 = ind_pre_min_and_min[nxt];
      int res = pref_min[n - 1];
      if (pos1 == n) {
        pos1 = 0;
      }
      if (pos1 > pos2) {
        res += pref_pre_pre_min[n - 1];
      }
      if (pos1 == n) {
        pos1 = 0;
      } else {
        res -= pref_pre_pre_min[pos1 - 1];
      }
      res += pref_pre_pre_min[pos2];
      if (res > ans) {
        ans = res;
        ansL = pos1 + 1;
        ansR = pos2 + 1;
      }
    }
  }
  cout << ans << "\n" << ansL << " " << ansR;
}
