#include <bits/stdc++.h>
inline void smax(int& s, const int& a) {
  if (s < a) s = a;
}
int a[300010];
char st[300010];
int main() {
  int n;
  std::cin >> n;
  auto nxt = [&](const int& k) { return k % n + 1; };
  std::cin >> (st + 1);
  a[0] = 0;
  for (int i = 1; i <= n; ++i) {
    if (st[i] == '(')
      a[i] = a[i - 1] + 1;
    else
      a[i] = a[i - 1] - 1;
  }
  if (a[n]) {
    std::cout << "0\n1 1\n";
    return 0;
  }
  int pos = std::min_element(a + 1, a + n + 1) - a, mn = a[pos], s1 = 0;
  std::pair<int, int> w1 = {1, 1};
  for (int i = nxt(pos), lst = 0, s = 0;; i = nxt(i)) {
    if (st[lst] != '(' && st[i] != '(') {
      if (i == pos) break;
      continue;
    }
    if (st[lst] != '(' && st[i] == '(') {
      lst = i;
      s = 0;
    }
    if (st[i] == ')') {
      if (s > s1) {
        s1 = s;
        w1 = std::make_pair(lst, i);
      }
    }
    if (a[i] < mn + 2) {
      lst = 0;
    }
    if (a[i] == mn + 2) {
      ++s;
    }
    if (i == pos) break;
  }
  s1 += std::count(a + 1, a + n + 1, mn);
  int s2 = 0;
  std::pair<int, int> w2 = {1, 1};
  for (int i = nxt(pos), lst = 0, s = 0;; i = nxt(i)) {
    if (st[lst] != '(' && st[i] != '(') {
      if (i == pos) break;
      continue;
    }
    if (st[lst] != '(' && st[i] == '(') {
      lst = i;
      s = 0;
    }
    if (st[i] == ')') {
      if (s > s2) {
        s2 = s;
        w2 = std::make_pair(lst, i);
      }
    }
    if (a[i] < mn + 1) {
      lst = 0;
    }
    if (a[i] == mn + 1) {
      ++s;
    }
    if (i == pos) break;
  }
  if (s1 > s2) {
    std::cout << s1 << '\n' << w1.first << ' ' << w1.second << '\n';
  } else {
    std::cout << s2 << '\n' << w2.first << ' ' << w2.second << '\n';
  }
}
