include [HTML_REMOVED]
using namespace std;
const int N = 1000010;
int len = 0;
bool a[N];
int idx[N];
int main() {
string s;
cin >> s;
for (int i = 0; i < s.size(); i) {
if (s[i] == ‘(‘)
idx[len] = i;
else {
if (len > 0) {
a[idx[len]] = true;
a[i] = true;
len–;
}
}
}
int ans = 0, cnt = 0, tmp = 0;
for (int i = 0; i <= s.size(); i) {
if (a[i] == 1)
tmp;
else {
ans = max(ans, tmp);
tmp = 0;
}
}
for (int i = 0; i <= s.size(); i++) {
if (a[i] == 1)
tmp++;
else {
if (ans == tmp) {
cnt++;
}
tmp = 0;
}
}
if (ans > 0)
cout << ans << ' ' << cnt;
else
cout << "0 1";
return 0;
}
//() ****