#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1000 * 100 + 100;
deque<pair<char, int>> d;
vector<int> v;
vector<pair<pair<int, int>, bool>> p;
long long mod = 1000 * 1000 * 1000 + 7;
int main() {
  ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  int n;
  cin >> n;
  string second;
  cin >> second;
  int a = 0, b = 0;
  for (int i = 0; i < n; i++) {
    if (second[i] == ')')
      a++;
    else
      b++;
    d.push_back({second[i], i});
  }
  if (a != b) {
    cout << 0 << endl << 1 << ' ' << 1 << endl;
    return 0;
  }
  int j = 0, cnt = 0;
  while (j != n) {
    if (cnt < 0) {
      cnt = 0;
      for (int i = 0; i < j; i++) {
        d.push_back(d.front());
        d.pop_front();
      }
      j = 0;
    }
    if (d[j].first == ')')
      cnt--;
    else
      cnt++;
    j++;
  }
  cnt = 0;
  for (int i = 0; i < n; i++) {
    if (d[i].first == '(') {
      v.push_back(i);
    } else {
      if (v.size() == 1) {
        p.push_back({{v.back(), i}, 1});
        cnt++;
      } else if (v.size() == 2) {
        p.push_back({{v.back(), i}, 0});
      }
      v.pop_back();
    }
  }
  int mx = cnt, r = 0, l = 0;
  for (int i = 0; i < p.size(); i++) {
    int x = p[i].first.first, y = p[i].first.second, t = 0;
    int c = 0;
    for (int j = x + 1; j < y; j++) {
      if (d[j].first == '(')
        c++;
      else
        c--;
      if (c == 0) t++;
    }
    if (p[i].second)
      t++;
    else
      t = t + cnt + 1;
    if (mx < t) {
      mx = t;
      l = d[x].second;
      r = d[y].second;
    }
  }
  cout << mx << endl << l + 1 << ' ' << r + 1 << endl;
  return 0;
}
