#include <bits/stdc++.h>
#pragma GCC optimize(2)
using namespace std;
template <typename T>
void read(T &x) {
  x = 0;
  char op = getchar();
  int F = 1;
  while (!isdigit(op)) {
    if (op == '-') F *= -1;
    op = getchar();
  }
  while (isdigit(op)) {
    x = (x << 1) + (x << 3) + op - '0';
    op = getchar();
  }
  x *= F;
}
template <typename T, typename... Args>
void read(T &x, Args &...args) {
  read(x);
  read(args...);
}
template <typename T1, typename T2>
void ckmax(T1 &x, T2 y) {
  if (x < y) x = y;
}
template <typename T1, typename T2>
void ckmin(T1 &x, T2 y) {
  if (x > y) x = y;
}
const int N = 300002 << 1;
string s;
int f[N], n;
int main() {
  cin >> n >> s;
  s = s + s;
  s = ' ' + s;
  for (int i = 1; i <= 2 * n; i++) {
    f[i] = f[i - 1] + (s[i] == '(' ? 1 : -1);
  }
  if (f[n] != 0) {
    puts("0");
    puts("1 1");
    exit(0);
  }
  int mn = *min_element(f + 1, f + n + 1);
  int cnt = 0, now = 0;
  for (int i = 1; i <= n; i++) {
    if (f[i] == mn) cnt++, now = i;
  }
  int ans = cnt, l = 1, r = 1;
  int nowl = now, tmp = 0;
  for (int i = now; i <= now + n - 1; i++) {
    if (f[i] < mn + 2) {
      if (cnt + tmp > ans) {
        ans = cnt + tmp;
        l = nowl % n + 1;
        r = (i - 1) % n + 1;
      }
      nowl = i, tmp = 0;
    } else
      tmp += (f[i] == (mn + 2));
  }
  tmp = 0, nowl = now;
  for (int i = now; i <= now + n; i++) {
    if (i == now + n || f[i] == mn) {
      if (tmp > ans) {
        ans = tmp;
        l = nowl % n + 1;
        r = (i - 1) % n + 1;
      }
      nowl = i, tmp = 0;
    } else
      tmp += (f[i] == (mn + 1));
  }
  printf("%d\n%d %d\n", ans, l, r);
  return 0;
}
