#include <bits/stdc++.h>
template <typename T>
inline void read(T &x) {
  char c;
  bool nega = 0;
  while ((!isdigit(c = getchar())) && (c != '-'))
    ;
  if (c == '-') {
    nega = 1;
    c = getchar();
  }
  x = c - 48;
  while (isdigit(c = getchar())) x = x * 10 + c - 48;
  if (nega) x = -x;
}
template <typename T>
inline void writep(T x) {
  if (x > 9) writep(x / 10);
  putchar(x % 10 + 48);
}
template <typename T>
inline void write(T x) {
  if (x < 0) {
    putchar('-');
    x = -x;
  }
  writep(x);
  putchar(' ');
}
template <typename T>
inline void writeln(T x) {
  write(x);
  putchar('\n');
}
using namespace std;
const long long mod = 1e9 + 7;
const long pp = 6e5 + 200;
int sum[pp], now[pp], sk[pp], dep[pp], top, L[pp], l, r;
string S, X;
int n, m, Qtion, id;
long long ans, res, cnt, mn;
int getbit(int bit, int ii) { return (bit >> ii) & 1; }
void dowork() {
  cin >> n >> S;
  S = " " + S;
  for (int i = (1); i <= (n); ++i) S += S[i];
  id = 1;
  for (int i = (1); i <= (n); ++i) {
    if (S[i] == '(')
      cnt++;
    else
      cnt--;
    if (cnt < mn) {
      mn = cnt;
      id = i + 1;
    }
  }
  if (cnt != 0) {
    cout << 0 << endl << 1 << " " << 1;
    return;
  }
  for (int i = (id); i <= (id + n - 1); ++i) {
    if (S[i] == '(')
      sk[++top] = i;
    else {
      sum[i] = now[top];
      now[top] = 0;
      L[i] = sk[top];
      --top;
      dep[i] = top;
      ++now[top];
    }
    if (top == 0) ++ans;
  }
  res = ans;
  l = r = 1;
  for (int i = (id + 1); i <= (id + n - 1); ++i)
    if (S[i] == ')') {
      if (dep[i] == 0 && ans < sum[i] + 1) ans = sum[i] + 1, l = L[i], r = i;
      if (dep[i] == 1 && ans < sum[i] + res + 1)
        ans = sum[i] + res + 1, l = L[i], r = i;
    }
  cout << ans << endl << (l - 1) % n + 1 << " " << (r - 1) % n + 1;
}
void openmain() {
  ios_base::sync_with_stdio(0);
  freopen(
      "1248D2"
      ".inp",
      "r", stdin);
  freopen(
      "1248D2"
      ".out",
      "w", stdout);
  cout.tie();
}
int main() {
  dowork();
  return 0;
}
