#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
using pli = pair<ll, int>;
const int INF = 0x3f3f3f3f, N = 3e5 + 5;
const ll LINF = 1e18 + 5;
constexpr int mod = 1e9 + 7;
int n, p[N];
char s[N];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  cin >> n >> (s + 1);
  for (int i = 1; i <= n; i++) p[i] = (p[i - 1] + (s[i] == '(' ? 1 : -1));
  if (p[n]) {
    cout << 0 << '\n' << 1 << ' ' << 1 << '\n';
    return 0;
  }
  int mn = *min_element(p + 1, p + n + 1);
  vector<int> vec;
  for (int i = 1; i <= n; i++)
    if (p[i] == mn) vec.push_back(i);
  int ans = (int)vec.size();
  pii pos = {1, 1};
  for (int i = 0; i < (int)vec.size() - 1; i++) {
    int j = vec[i] + 1, k = vec[i + 1] - 1;
    if (j > k) continue;
    int one = 0, two = 0, tmp = 0, st = 0;
    pii pp = {0, 0};
    for (int _ = j; _ <= k; _++) {
      if (p[_] == mn + 1) {
        ++one;
        tmp = st = 0;
      }
      if (p[_] == mn + 2) {
        ++tmp;
        if (!st) st = _;
      }
      if (tmp > two) {
        two = tmp;
        pp = {st, _ % n + 1};
      }
    }
    if (one > ans) ans = one, pos = {j, k % n + 1};
    if (two + (int)vec.size() > ans) ans = two + (int)vec.size(), pos = pp;
  }
  int one = 0, two = 0, tmp = 0, st = 0;
  pii pp = {0, 0};
  for (int _ = vec.back() % n + 1; _ != vec.front(); _ = _ % n + 1) {
    if (p[_] == mn + 1) {
      ++one;
      tmp = st = 0;
    }
    if (p[_] == mn + 2) {
      ++tmp;
      if (!st) st = _;
    }
    if (tmp > two) {
      two = tmp;
      pp = {st, _ % n + 1};
    }
  }
  if (one > ans) ans = one, pos = {vec.back() % n + 1, vec.front()};
  if (two + (int)vec.size() > ans) ans = two + (int)vec.size(), pos = pp;
  cout << ans << '\n';
  cout << pos.first << ' ' << pos.second << '\n';
  return 0;
}
