#include <bits/stdc++.h>
using namespace std;
const int N = 6e5 + 10;
int ans = 0, l = 0, r = 0;
int diff[N];
void evalDiff(string s) {
  s += s;
  for (int i = 0; i < s.size(); i++)
    diff[i + 1] = diff[i] + (s[i] == '(' ? 1 : -1);
}
int count(int v, int b) {
  int cnt = 0;
  for (int i = 0; i < b; i++)
    if (diff[i] == v) cnt++;
  return cnt;
}
int Less(vector<int> &cnt, int v) {
  int ans = 0;
  for (int i = v - 1; i >= 0; i--) ans += cnt[i];
  return ans;
}
void solve(int n) {
  if (diff[n] != 0) return;
  int m = *min_element(diff, diff + n + 1);
  vector<int> cnt(n + 1);
  for (int i = 0; i < n; i++) cnt[diff[i] - m]++;
  for (int v : {m, m + 1, m + 2}) {
    vector<int> curCnt(n + 1);
    for (int i = 1, j = 1; i <= 2 * n; curCnt[diff[i] - m]--, i++) {
      for (; j <= 2 * n && Less(curCnt, v - m) < Less(cnt, v - m); j++)
        curCnt[diff[j] - m]++;
      if (Less(curCnt, v - m) < Less(cnt, v - m)) break;
      if (diff[i] >= v) continue;
      if (ans > cnt[v - m] - curCnt[v - m] + Less(curCnt, v - 1 - m)) continue;
      ans = cnt[v - m] - curCnt[v - m] + Less(curCnt, v - 1 - m);
      l = i - 1;
      r = j - 1;
    }
  }
}
int main() {
  iostream::sync_with_stdio(false);
  int n;
  cin >> n;
  string s;
  cin >> s;
  evalDiff(s);
  solve(n);
  cout << ans << '\n';
  cout << l % n + 1 << ' ' << r % n + 1 << '\n';
}
