#include <bits/stdc++.h>
using namespace std;
inline long long mod(long long n, long long m) {
  long long ret = n % m;
  if (ret < 0) ret += m;
  return ret;
}
long long gcd(long long a, long long b) {
  return (b == 0LL ? a : gcd(b, a % b));
}
long long exp(long long a, long long b, long long m) {
  if (b == 0LL) return 1LL;
  if (b == 1LL) return mod(a, m);
  long long k = mod(exp(a, b / 2, m), m);
  if (b & 1LL) {
    return mod(a * mod(k * k, m), m);
  } else
    return mod(k * k, m);
}
struct node {
  long long pre;
  long long sum;
  node operator+(const node &o) const {
    node r;
    r.sum = sum + o.sum;
    r.pre = min(pre, sum + o.pre);
    return r;
  }
};
template <class T>
struct ST {
  vector<T> st;
  long long n;
  T ini;
  ST(long long n, T ini) : st(2 * n, ini), n(n), ini(ini) {}
  void upd(long long pos, T val) {
    for (st[pos += n] = val; pos /= 2;) st[pos] = st[2 * pos] + st[2 * pos + 1];
  }
  T query(long long x, long long y) {
    T ra = ini, rb = ini;
    for (x += n, y += n + 1; x < y; x /= 2, y /= 2) {
      if (x & 1) ra = ra + st[x++];
      if (y & 1) rb = st[--y] + rb;
    }
    return ra + rb;
  }
};
long long n;
const long long N = 600100;
char s[N];
node make(long long x) {
  node r;
  r.sum = x;
  r.pre = min(0LL, x);
  return r;
}
long long val(char c) {
  if (c == '(') return 1;
  return -1;
}
long long best = 0;
pair<long long, long long> res = pair<long long, long long>(1, 1);
ST<node> T(1, make(0));
void tenta(long long l, long long r) {
  l %= n;
  r %= n;
  long long v1 = val(s[l]);
  long long v2 = val(s[r]);
  T.upd(r, make(v1));
  T.upd(r + n, make(v1));
  T.upd(l, make(v2));
  T.upd(l + n, make(v2));
  long long tot = 0;
  for (long long i = 0; i < n; i++) {
    node x = T.query(i, i + n - 1);
    if (x.pre >= 0 and x.sum == 0) tot++;
  }
  if (best < tot) {
    best = tot;
    res = pair<long long, long long>(l + 1, r + 1);
  }
  T.upd(r, make(v2));
  T.upd(r + n, make(v2));
  T.upd(l, make(v1));
  T.upd(l + n, make(v1));
}
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  cin >> n;
  for (long long i = 0; i < n; i++) {
    cin >> s[i];
    s[i + n] = s[i];
  }
  T = ST<node>(2 * n + 10, make(0));
  for (long long i = 0; i < 2 * n; i++) {
    if (s[i] == '(')
      T.upd(i, make(1));
    else
      T.upd(i, make(-1));
  }
  vector<long long> p;
  long long ini = -1;
  for (long long it = 0; it < n; it++) {
    node x = T.query(it, it + n - 1);
    if (x.pre >= 0 and x.sum == 0) {
      best++;
      if (ini == -1) ini = it;
      p.push_back(it);
    }
  }
  if (ini == -1) {
    cout << "0\n1 1\n";
    return 0;
  }
  for (long long x : p) {
    long long has = 0;
    ini = x + 1;
    long long end = 0;
    for (long long i = x; i < x + n; i++) {
      has += val(s[i]);
      if (has == 0) {
        end = i;
        break;
      }
    }
    vector<pair<long long, long long> > pos;
    has = 0;
    ini = x + 1;
    for (long long i = x + 1; i < end; i++) {
      has += val(s[i]);
      if (has == 0) {
        pos.push_back(pair<long long, long long>(ini, i));
        ini = i + 1;
      }
    }
    long long inside = pos.size();
    long long op1 = inside + 1;
    if (best < op1) {
      best = op1;
      res = pair<long long, long long>((x) % n + 1, (end % n) + 1);
    }
    for (long long i = 0; i < pos.size(); i++) {
      long long l = pos[i].first;
      long long r = pos[i].second;
      long long has = 0;
      inside = 0;
      for (long long j = l + 1; j < r; j++) {
        has += val(s[j]);
        if (has == 0) inside++;
      }
      l %= n, r %= n;
      long long cur = 1 + inside + 1 + p.size() - 1;
      if (best < cur) {
        best = cur;
        res = pair<long long, long long>(l + 1, r + 1);
      }
    }
  }
  cout << best << "\n";
  cout << res.first << " " << res.second << "\n";
}
