#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string s;
  cin >> n >> s;
  int arr[2 * n];
  int cnt = 0;
  int mn = INT_MAX;
  for (int i = 0; i < n; i++) {
    s[i] == '(' ? cnt++ : cnt--;
    arr[i] = cnt;
    if (arr[i] < mn) {
      mn = arr[i];
    }
  }
  for (int i = n; i < 2 * n; i++) {
    arr[i] = arr[i - n];
  }
  if (arr[n - 1] != 0) {
    cout << "0\n1 1";
    return 0;
  }
  int total = 0;
  for (int i = 0; i < n; i++) {
    if (arr[i] == mn) {
      total++;
    }
  }
  int cn = 0;
  int start = 0, end = 0;
  int start_before = -1;
  int ans = total;
  for (int i = 0; i < 2 * n; i++) {
    if (arr[i] == mn + 2) {
      cn++;
    }
    if (arr[i] == mn || arr[i] == mn + 1) {
      cn = 0;
      start_before = i;
    }
    if (total + cn > ans) {
      ans = total + cn;
      start = (start_before + 1) % n;
      end = (i + 1) % n;
    }
  }
  cn = 0;
  start_before = -1;
  for (int i = 0; i < 2 * n; i++) {
    if (arr[i] == mn + 1) {
      cn++;
    }
    if (arr[i] == mn) {
      cn = 0;
      start_before = i;
    }
    if (cn > ans) {
      ans = cn;
      start = (start_before + 1) % n;
      end = (i + 1) % n;
    }
  }
  cout << ans << "\n" << start + 1 << " " << end + 1;
}
