#include <bits/stdc++.h>
using namespace std;
const int mod = 1000000000 + 7;
int addm(int& a, int b) { return (a += b) < mod ? a : a -= mod; }
template <class T, class U>
bool smin(T& a, U b) {
  return a > b ? (a = b, 1) : 0;
}
template <class T, class U>
bool smax(T& a, U b) {
  return a < b ? (a = b, 1) : 0;
}
int n;
int cs[300000];
string s;
int m, mc;
int ans;
int l, r;
int val(int i) { return cs[i % n]; }
int pos(int i) { return i % n; }
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cin >> n;
  cin >> s;
  cs[0] = 0;
  for (int i = 0; i + 1 < n; ++i) {
    if (s[i] == '(')
      cs[i + 1] = cs[i] + 1;
    else
      cs[i + 1] = cs[i] - 1;
  }
  if (cs[n - 1] + (s[n - 1] == '(' ? 1 : -1) != 0) {
    cout << "0\n1 1\n";
    return 0;
  }
  m = *min_element(cs, cs + n);
  for (int i = 0; i < n; ++i)
    if (cs[i] == m) mc++;
  ans = mc;
  l = r = 1;
  for (int i = 0, j = 0, ct = 0; j < 2 * n;) {
    if (val(j) < m + 2) {
      i = j + 1;
      ct = 0;
    } else if (val(j) == m + 2) {
      ct++;
    }
    ++j;
    if (j - i > n) {
      if (val(i) == m + 2) ct--;
      ++i;
    }
    if (ct + mc > ans) {
      ans = ct + mc;
      l = i;
      r = j;
    }
  }
  for (int i = 0, j = 0, ct = 0; j < 2 * n;) {
    if (val(j) < m + 1) {
      i = j + 1;
      ct = 0;
    } else if (val(j) == m + 1) {
      ct++;
    }
    ++j;
    if (j - i > n) {
      if (val(i) == m + 1) ct--;
      ++i;
    }
    if (ct > ans) {
      ans = ct;
      l = i;
      r = j;
    }
  }
  if (l != r) {
    l = (l + n - 1) % n;
    while (s[l] != '(') {
      --l;
      if (l == -1) l = n - 1;
    }
    r = (r + n - 1) % n;
    while (s[r] != ')') {
      ++r;
      if (r == n) r = 0;
    }
    ++l;
    ++r;
  }
  cout << ans << '\n';
  cout << l << ' ' << r << '\n';
}
