#include <bits/stdc++.h>
using namespace std;
const int Nmax = 1e6 + 7;
int n;
string s;
int dp[Nmax];
vector<int> v;
int ans, ans1, ans2;
inline int get(string s) {
  int cnt = 0;
  int mx = 4 * n;
  ans = 0;
  for (int i = 0; i < n; i++) {
    if (s[i] == ')')
      cnt--;
    else
      cnt++;
    if (cnt < mx) {
      mx = cnt;
      ans = i;
    }
  }
  int pos = ans;
  if (cnt != 0) return 0;
  s = s + s;
  dp[0] = 0;
  ans = 0;
  ans1 = 1, ans2 = 1;
  for (int i = pos + 1, j = 0; j < n; j++, i++) {
    if (s[i] == '(')
      dp[j + 1] = dp[j] + 1;
    else
      dp[j + 1] = dp[j] - 1;
  }
  for (int i = 0; i <= n; i++) {
    if (!dp[i]) {
      v.push_back(i);
      ans++;
    }
  }
  ans--;
  int zero = ans;
  int sum = v.size();
  for (int i = 0; i < sum - 1; i++) {
    int j = i + 1;
    int cnt = 0;
    for (int k = v[i]; k <= v[j]; k++) {
      if (dp[k] == 1) cnt++;
    }
    if (cnt > ans) {
      ans = cnt;
      ans1 = v[i] + 1, ans2 = v[j];
    }
  }
  v.clear();
  for (int i = 1; i <= n; i++)
    if (dp[i] == 1) v.push_back(i);
  sum = v.size();
  for (int i = 0; i < sum - 1; i++) {
    int j = i + 1;
    int cnt = 0;
    for (int k = v[i]; k <= v[j]; k++) {
      if (dp[k] == 2) cnt++;
      if (dp[k] < 1) {
        cnt = 0;
        break;
      }
    }
    if (cnt + zero > ans) {
      ans = cnt + zero;
      ans1 = v[i] + 1, ans2 = v[j];
    }
  }
  pos++;
  ans1 += pos, ans2 += pos;
  if (ans1 > n) ans1 %= n;
  if (ans2 > n) ans2 %= n;
  cout << ans << endl;
  cout << ans1 << " " << ans2 << endl;
  return ans;
}
int main() {
  cin >> n;
  cin >> s;
  int ans = 0, ans1 = 1, ans2 = 1;
  if (get(s) == 0) {
    cout << ans << endl;
    cout << ans1 << " " << ans2 << endl;
    return 0;
  }
  return 0;
}
