#include <bits/stdc++.h>
using namespace std;
template <typename T>
struct outputer;
struct outputable {};
template <typename T>
inline auto sqr(T x) -> decltype(x * x) {
  return x * x;
}
template <typename T1, typename T2>
inline bool umx(T1& a, T2 b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <typename T1, typename T2>
inline bool umn(T1& a, T2 b) {
  if (b < a) {
    a = b;
    return 1;
  }
  return 0;
}
const int N = 300000;
struct Input {
  int n;
  string s;
  bool read() { return !!(cin >> n >> s); }
  void init(const Input& input) { *this = input; }
};
struct Data : Input {
  int ans;
  int ans_l, ans_r;
  void write() { cout << ans << endl << ans_l + 1 << ' ' << ans_r + 1 << endl; }
};
namespace Main {
struct Solution : Data {
  int a[N + 1];
  void calc(int k) {
    int cnt = 0;
    for (int i = int(0); i < int(n); ++i) {
      if (a[i] == k) {
        cnt++;
      }
    };
    int mx = 0;
    int l = 0, r = 0;
    for (int i = 0; i < n;) {
      if (a[i] < k + 2) {
        ++i;
        continue;
      }
      int cur = 0;
      int j = i;
      while (a[j % n] >= k + 2) {
        cur += (a[j % n] == k + 2);
        ++j;
      };
      if (umx(mx, cur)) {
        l = (i + n - 1) % n;
        r = (j + n - 1) % n;
      }
      i = j;
    }
    if (umx(ans, cnt + mx)) {
      ans_l = l;
      ans_r = r;
    }
  }
  void solve() {
    a[0] = 0;
    for (int i = int(0); i < int(n); ++i) {
      a[i + 1] = a[i];
      if (s[i] == '(') {
        a[i + 1]++;
      } else {
        a[i + 1]--;
      }
    };
    ans = 0;
    ans_l = ans_r = 0;
    if (a[n] != a[0]) {
      return;
    }
    int mn = 0;
    for (int i = int(0); i < int(n); ++i) {
      umn(mn, a[i]);
    }
    calc(mn);
    calc(mn - 1);
  }
  void clear() { *this = Solution(); }
};
}  // namespace Main
Main::Solution sol;
int main() {
  cout.setf(ios::showpoint | ios::fixed);
  cout.precision(20);
  sol.read();
  sol.solve();
  sol.write();
  return 0;
}
