//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>
//using namespace __gnu_pbds;
//#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define dd double
#define ld long double
#define ull unsigned long long
#define yes cout << "YES\n"
#define no cout << "NO\n"
#define el "\n"
#define Arwa ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define fix(x) cout << fixed << setprecision(x)
#define all(v) v.begin(),v.end()
void file()
{
#ifndef ONLINE_JUDGE
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
#endif
}
int gcd(int a, int b) { return b == 0 ? a : gcd(b, a % b); }
int lcm(int a, int b) { return a / gcd(a, b) * b; }
bool prime(int n) {
if (n == 2) return true;
if (n % 2 == 0 || n == 1) return false;
for (int i = 3; i * i <= n; i += 2)
if (n % i == 0) return false;
return true;
}
//Here We Go Again
int32_t main()
{
Arwa
//file();
int t=1;
//cin>>t;
while(t--)
{
stack<char>mx;
bool f=0,f2=0;
int maxlength=0,count=0,maxx=0;
string s;
cin>>s;
for(int i=0;i<s.length();i++)
{
if(s[i]=='('||s[i]=='<'||s[i]=='{'||s[i]=='[')
{
mx.push(s[i]);
f=1;
}
else if(!mx.empty())
{
if(s[i]=='}'&&mx.top()=='{')
{
mx.pop();
if(mx.empty())
f2=1;
}
else if(s[i]==')'&&mx.top()=='(')
{
mx.pop();
if(mx.empty())
f2=1;
}
else if(s[i]=='>'&&mx.top()=='<')
{
mx.pop();
if(mx.empty())
f2=1;
}
else if(s[i]==']'&&mx.top()=='[')
{
mx.pop();
if(mx.empty())
f2=1;
}
else
{
maxlength=0;
f2=0;
}
}
if(mx.empty()&&f&&f2)
{
count++;
if(maxx<maxlength)
maxx=maxlength;
}
maxlength=max(maxlength,(int)mx.size()*2);
//cout<<maxx<<' '<<count<<el;
}
if(maxx==0&&count==0)
cout<<"0 1";
else cout<<maxx<<' '<<count<<el;
}
return 0;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I7IH0KYm9vbCBwcmltZShpbnQgbikgewogICAgaWYgKG4gPT0gMikgcmV0dXJuIHRydWU7CiAgICBpZiAobiAlIDIgPT0gMCB8fCBuID09IDEpIHJldHVybiBmYWxzZTsKICAgIGZvciAoaW50IGkgPSAzOyBpICogaSA8PSBuOyBpICs9IDIpCiAgICAgICAgaWYgKG4gJSBpID09IDApIHJldHVybiBmYWxzZTsKICAgIHJldHVybiB0cnVlOwp9Ci8vSGVyZSBXZSBHbyBBZ2FpbgppbnQzMl90IG1haW4oKSAKewogICAgQXJ3YQogICAgLy9maWxlKCk7CiAgICBpbnQgdD0xOwogICAgLy9jaW4+PnQ7CiAgICB3aGlsZSh0LS0pIAogICAgewogICAgICBzdGFjazxjaGFyPm14OwogICAgICBib29sIGY9MCxmMj0wOwogICAgICBpbnQgbWF4bGVuZ3RoPTAsY291bnQ9MCxtYXh4PTA7CiAgICAgIHN0cmluZyBzOwogICAgICBjaW4+PnM7CiAgICAgIGZvcihpbnQgaT0wO2k8cy5sZW5ndGgoKTtpKyspCiAgICAgIHsKICAgICAgICBpZihzW2ldPT0nKCd8fHNbaV09PSc8J3x8c1tpXT09J3snfHxzW2ldPT0nWycpCiAgICAgICAgewogICAgICAgIG14LnB1c2goc1tpXSk7CiAgICAgICAgZj0xOwogICAgICAgIH0KICAgICAgICBlbHNlIGlmKCFteC5lbXB0eSgpKQogICAgICAgIHsKICAgICAgICBpZihzW2ldPT0nfScmJm14LnRvcCgpPT0neycpCiAgICAgICAgewogICAgICAgIG14LnBvcCgpOwogICAgICAgIGlmKG14LmVtcHR5KCkpCiAgICAgICAgZjI9MTsKICAgICAgICB9CiAgICAgICAgZWxzZSBpZihzW2ldPT0nKScmJm14LnRvcCgpPT0nKCcpCiAgICAgICAgewogICAgICAgIG14LnBvcCgpOwogICAgICAgIGlmKG14LmVtcHR5KCkpCiAgICAgICAgZjI9MTsKICAgICAgICB9CiAgICAgICAgZWxzZSBpZihzW2ldPT0nPicmJm14LnRvcCgpPT0nPCcpCiAgICAgICAgewogICAgICAgIG14LnBvcCgpOwogICAgICAgIGlmKG14LmVtcHR5KCkpCiAgICAgICAgZjI9MTsKICAgICAgICB9CiAgICAgICAgZWxzZSBpZihzW2ldPT0nXScmJm14LnRvcCgpPT0nWycpCiAgICAgICAgewogICAgICAgIG14LnBvcCgpOwogICAgICAgIGlmKG14LmVtcHR5KCkpCiAgICAgICAgZjI9MTsKICAgICAgICB9CiAgICAgICAgZWxzZSAKICAgICAgICB7CiAgICAgICAgbWF4bGVuZ3RoPTA7CiAgICAgICAgZjI9MDsKICAgICAgICB9CiAgICAgICAgfQogICAgICAgIGlmKG14LmVtcHR5KCkmJmYmJmYyKQogICAgICAgIHsKICAgICAgICBjb3VudCsrOwogICAgICAgIGlmKG1heHg8bWF4bGVuZ3RoKQogICAgICAgIG1heHg9bWF4bGVuZ3RoOwogICAgICAgIH0KICAgICAgICBtYXhsZW5ndGg9bWF4KG1heGxlbmd0aCwoaW50KW14LnNpemUoKSoyKTsKICAgICAgICAvL2NvdXQ8PG1heHg8PCcgJzw8Y291bnQ8PGVsOwogICAgICB9CiAgICBpZihtYXh4PT0wJiZjb3VudD09MCkKICAgIGNvdXQ8PCIwIDEiOwogICAgZWxzZSBjb3V0PDxtYXh4PDwnICc8PGNvdW50PDxlbDsKICAgIH0KICAgIHJldHVybiAwOwp9Cg==