//#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--)
{
string s;
stack<char>st;
map<int,int>m;
vector<int>v,vv;
cin>>s;
for(int i=0;i<s.length();i++)
{
if(s[i]=='('||s[i]=='{'||s[i]=='['||s[i]=='<')
st.push(i);
else if(!st.empty())
{
if(s[i]==')'&&s[st.top()]=='(')
st.pop();
else if(s[i]=='}'&&s[st.top()]=='{')
st.pop();
else if(s[i]==']'&&s[st.top()]=='[')
st.pop();
else if(s[i]=='>'&&s[st.top()]=='<')
st.pop();
}
else v.push_back(i);
}
if(!st.empty())
{
while(!st.empty())
{
v.push_back(st.top());
st.pop();
}
}
if(v.size())
{
sort(all(v));
//for(auto it:v)
//cout<<it<<' ';
//cout<<el;
for(int i=v.size()-1;i>0;i--)
{
if(v[i]-v[i-1]-1!=0)
vv.push_back(v[i]-v[i-1]-1);
}
vv.push_back(s.size()-1-v[v.size()-1]);
}
else vv.push_back(s.length());
for(auto it:vv)
{
//cout<<it<<' ';
if(it!=0)
m[it]++;
}
int max=0,mx=0;
for(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7IHJldHVybiBiID09IDAgPyBhIDogZ2NkKGIsIGEgJSBiKTsgfQppbnQgbGNtKGludCBhLCBpbnQgYikgeyByZXR1cm4gYSAvIGdjZChhLCBiKSAqIGI7IH0KYm9vbCBwcmltZShpbnQgbikgewogICAgaWYgKG4gPT0gMikgcmV0dXJuIHRydWU7CiAgICBpZiAobiAlIDIgPT0gMCB8fCBuID09IDEpIHJldHVybiBmYWxzZTsKICAgIGZvciAoaW50IGkgPSAzOyBpICogaSA8PSBuOyBpICs9IDIpCiAgICAgICAgaWYgKG4gJSBpID09IDApIHJldHVybiBmYWxzZTsKICAgIHJldHVybiB0cnVlOwp9Ci8vSGVyZSBXZSBHbyBBZ2FpbgppbnQzMl90IG1haW4oKSAKewogICAgQXJ3YQogICAgLy9maWxlKCk7CiAgICBpbnQgdD0xOwogICAgLy9jaW4+PnQ7CiAgICB3aGlsZSh0LS0pIAogICAgewogICAgIHN0cmluZyBzOwogICAgIHN0YWNrPGNoYXI+c3Q7CiAgICAgbWFwPGludCxpbnQ+bTsKICAgICB2ZWN0b3I8aW50PnYsdnY7CiAgICAgY2luPj5zOwogICAgIGZvcihpbnQgaT0wO2k8cy5sZW5ndGgoKTtpKyspCiAgICAgewogICAgICAgIGlmKHNbaV09PScoJ3x8c1tpXT09J3snfHxzW2ldPT0nWyd8fHNbaV09PSc8JykKICAgICAgICBzdC5wdXNoKGkpOwogICAgICAgIGVsc2UgaWYoIXN0LmVtcHR5KCkpCiAgICAgICAgewogICAgICAgICAgICBpZihzW2ldPT0nKScmJnNbc3QudG9wKCldPT0nKCcpCiAgICAgICAgICAgIHN0LnBvcCgpOwogICAgICAgICAgICBlbHNlIGlmKHNbaV09PSd9JyYmc1tzdC50b3AoKV09PSd7JykKICAgICAgICAgICAgc3QucG9wKCk7CiAgICAgICAgICAgIGVsc2UgaWYoc1tpXT09J10nJiZzW3N0LnRvcCgpXT09J1snKQogICAgICAgICAgICBzdC5wb3AoKTsKICAgICAgICAgICAgZWxzZSBpZihzW2ldPT0nPicmJnNbc3QudG9wKCldPT0nPCcpCiAgICAgICAgICAgIHN0LnBvcCgpOwogICAgICAgIH0KICAgICAgICBlbHNlIHYucHVzaF9iYWNrKGkpOwogICAgfQogICAgaWYoIXN0LmVtcHR5KCkpCiAgICB7CiAgICB3aGlsZSghc3QuZW1wdHkoKSkKICAgIHsKICAgIHYucHVzaF9iYWNrKHN0LnRvcCgpKTsKICAgIHN0LnBvcCgpOwogICAgfQogICAgfQogICAgaWYodi5zaXplKCkpCiAgICB7CiAgICBzb3J0KGFsbCh2KSk7CiAgICAvL2ZvcihhdXRvIGl0OnYpCiAgICAvL2NvdXQ8PGl0PDwnICc7CiAgICAvL2NvdXQ8PGVsOwogICAgZm9yKGludCBpPXYuc2l6ZSgpLTE7aT4wO2ktLSkKICAgIHsKICAgIGlmKHZbaV0tdltpLTFdLTEhPTApCiAgICB2di5wdXNoX2JhY2sodltpXS12W2ktMV0tMSk7CiAgICB9CiAgICB2di5wdXNoX2JhY2socy5zaXplKCktMS12W3Yuc2l6ZSgpLTFdKTsKICAgIH0KICAgIGVsc2UgdnYucHVzaF9iYWNrKHMubGVuZ3RoKCkpOwogICAgZm9yKGF1dG8gaXQ6dnYpCiAgICB7CiAgICAvL2NvdXQ8PGl0PDwnICc7CiAgICBpZihpdCE9MCkKICAgIG1baXRdKys7CiAgICB9CiAgICBpbnQgbWF4PTAsbXg9MDsKICAgIGZvcihpbnQgaT0wO2k8dnYuc2l6ZSgpO2krKykKICAgIHsKICAgICAgICBpZih2dltpXT5tYXgpCiAgICAgICAgewogICAgICAgICAgICBteD1tW3Z2W2ldXTsKICAgICAgICAgICAgbWF4PXZ2W2ldOwogICAgICAgIH0KICAgIH0KICAgIGlmKG14PT0wKQogICAgY291dDw8MDw8JyAnPDwxPDxlbDsKICAgIGVsc2UgY291dDw8bWF4PDwnICc8PG14PDxlbDsKCiAgICB9CiAgICByZXR1cm4gMDsKfQoKCg==