#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int i, j, k, n;
  cin >> n;
  string s;
  cin >> s;
  long long int dizi[2 * n + 2], mini = 0, son = 0, say = 0;
  for (i = 0; i < n; i++) {
    if (s[i] == '(')
      son++;
    else
      son--;
    dizi[i] = son;
    mini = fmin(mini, son);
  }
  if (son != 0) {
    cout << 0 << endl << 1 << " " << 1 << endl;
    return 0;
  }
  pair<long long int, long long int> cev = make_pair(1, 1);
  pair<long long int, pair<long long int, long long int>> temp = make_pair(
                                                              0,
                                                              make_pair(0, 0)),
                                                          maks = make_pair(
                                                              0,
                                                              make_pair(0, 0));
  for (i = 0; i < n; i++) dizi[i] -= mini;
  long long int ret = 0;
  for (i = 0; i < n; i++)
    if (dizi[i] == 0) ret++;
  long long int fzero = 0, fone = 0;
  for (i = 0; i < n; i++)
    if (dizi[i] == 0) {
      fzero = i;
      break;
    }
  for (i = 0; i < n; i++)
    if (dizi[i] == 1) {
      fone = i;
      break;
    }
  for (i = 0; i < n; i++) dizi[i + n] = dizi[i];
  long long int l = fzero + 1, r;
  temp.second.first = l;
  if (ret == n / 2) {
    cout << ret << endl << 1 << " " << 1 << endl;
    return 0;
  }
  for (i = fzero + 1; i < n + fzero + 1; i++) {
    if (dizi[i] == 0) {
      temp.second.second = i % n;
      if (temp.first > maks.first) maks = temp;
      temp = make_pair(0, make_pair(0, 0));
      temp.second.first = (i + 1) % n;
    }
    if (dizi[i] == 1) {
      temp.first++;
    }
  }
  temp = make_pair(ret, make_pair(0, 0));
  temp.second.first = fone + 1;
  for (i = fone + 1; i < n + fone + 1; i++) {
    if (dizi[i] == 1) {
      temp.second.second = i % n;
      if (temp.first > maks.first) maks = temp;
      temp = make_pair(ret, make_pair(0, 0));
      temp.second.first = (i + 1) % n;
    }
    if (dizi[i] == 2) {
      temp.first++;
    }
  }
  cout << maks.first << endl
       << maks.second.first + 1 << " " << maks.second.second + 1;
  return 0;
}
