#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> n;
  string s;
  cin >> s;
  vector<int> g;
  int mini = 0;
  int id = 0;
  int level = 0;
  int bal = 0;
  for (int i = 0; i < s.size(); i++) {
    if (s[i] == ')')
      bal++;
    else
      bal--;
    if (s[i] == ')') level--;
    if (mini > level && s[i] == '(') {
      mini = level;
      id = i;
    }
    g.push_back(level);
    if (s[i] == '(') level++;
  }
  if (bal != 0) {
    cout << 0 << endl;
    cout << 1 << ' ' << 1 << endl;
    return 0;
  }
  mini *= -1;
  for (int i = 0; i < n; i++) {
    g[i] += mini;
  }
  int ciclos = 0;
  for (int i = 0; i < n; i++) {
    if (g[(id + i) % n] == 0) ciclos++;
  }
  ciclos /= 2;
  int maxi = ciclos;
  int l = 0;
  int r = 0;
  int pl = 0;
  int pr = 0;
  int cont = 0;
  for (int i = 0; i < n; i++) {
    if (g[(i + id) % n] == 2) cont++;
    if (g[(i + id) % n] == 1 && s[(id + i) % n] == '(') {
      cont = 0;
      pl = (i + id) % n;
    }
    if (g[(i + id) % n] == 1 && s[(id + i) % n] == ')') {
      cont /= 2;
      cont++;
      cont += ciclos;
      pr = (i + id) % n;
      if (cont > maxi) {
        maxi = cont;
        l = pl;
        r = pr;
      }
    }
  }
  cont = 0;
  for (int i = 0; i < n; i++) {
    if (g[(i + id) % n] == 1) cont++;
    if (g[(i + id) % n] == 0 && s[(id + i) % n] == '(')
      cont = 0, pl = (i + id) % n;
    if (g[(i + id) % n] == 0 && s[(id + i) % n] == ')') {
      cont /= 2;
      cont++;
      pr = (i + id) % n;
      if (cont > maxi) {
        maxi = cont;
        l = pl;
        r = pr;
      }
    }
  }
  l++;
  r++;
  cout << maxi << endl;
  cout << l << " " << r << endl;
}
