#include <bits/stdc++.h>
using namespace std;
void PUNKS_NOT_DEAD() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  int balance = 0, mx_balance = +1e9, j;
  for (int i = 0; i < n; i++) {
    balance += (s[i] == '(' ? +1 : -1);
    if (balance < mx_balance) {
      j = i;
      mx_balance = balance;
    }
  }
  if (balance != 0) {
    cout << 0 << endl << 1 << ' ' << 1;
    exit(0);
  }
  vector<int> b(n);
  s = s.substr(j + 1) + s.substr(0, j + 1);
  for (int i = 0; i < n; i++) {
    balance += (s[i] == '(' ? +1 : -1);
    b[i] = balance;
  }
  int cnt0 = count(b.begin(), b.end(), 0);
  int best = cnt0, ls = 0, rs = 0;
  for (int l = 0; l < n - 1; l++) {
    int r = l, cnt = 0;
    while (b[r] != 0 && r + 1 < n) {
      cnt += (b[r] == 1);
      r++;
    }
    if (cnt > best) {
      best = cnt, ls = l, rs = r;
    }
    l = r;
  }
  for (int l = 0; l < n - 1; l++) {
    int r = l, cnt = 0;
    while (b[r] > 1 && r + 1 < n) {
      cnt += (b[r] == 2);
      r++;
    }
    if (cnt + cnt0 > best) {
      best = cnt + cnt0, ls = l, rs = r;
    }
    l = r;
  }
  cout << best << endl << (ls + j + 1) % n + 1 << ' ' << (rs + j + 1) % n + 1;
}
signed main() {
  ios_base::sync_with_stdio(false), cin.tie(0), PUNKS_NOT_DEAD();
}
