#include <iostream>
#include <vector>
#include <stdlib.h>
#include <stdio.h>
#include <algorithm>
using namespace std;

#define ll long long

ll a1,a2;

string s;
string ans1,ans2;
vector<string> v,v1,v2;
string num;
int carry,flag;
string ans;

int main(){

	//freopen("sample.txt","r",stdin);
	std::string::size_type sz;
	cin>>s;
	int n = s.size();
	int i = 0;
	while(i<n){
		if(s[i]>='a' && s[i]<='z'){
			i++;
			continue;
		}
		num.clear();
		while(i<n && (s[i]=='.' || (s[i]>='0' && s[i]<='9'))){
			num.push_back(s[i]);
			i++;
		}
		v.push_back(num);
	}
	for(int i=0;i<v.size();i++){
		int j = v[i].size();
		if(j>3){
			if(v[i][j-3]=='.'){
				num.clear();
				num.push_back(v[i][j-2]);
				num.push_back(v[i][j-1]);
				v1.push_back(num);
				num.clear();
				for(int k=0;k<j-3;k++){
					if(v[i][k]!='.') num.push_back(v[i][k]);
				}
				v2.push_back(num);
			}
			else{
				num.clear();
				for(int k=0;k<j;k++){
					if(v[i][k]!='.') num.push_back(v[i][k]);
				}
				v2.push_back(num);
			}
		}
		else{
			num.clear();
			for(int k=0;k<j;k++){
				if(v[i][k]!='.') num.push_back(v[i][k]);
			}
			v2.push_back(num);
		}
	}
	if(!v1.empty()){
		for(int i=0;i<v1.size();i++){
			a1 += stoi(v1[i],&sz);
		}
		carry = a1/100;
		flag = 0;
		a1 = a1%100;
		char buffer[33];
		if(a1 < 10){
			flag = 1;
		}
		sprintf(buffer,"%lld",a1);
		if(flag) ans1.push_back('0');
		ans1 += buffer;
		//cout<<ans1<<endl;
	}
	for(int i=0;i<v2.size();i++){
		a2 += stoi(v2[i],&sz);
	}
	if(carry) a2 += 1;
	char buffer[33];
	sprintf(buffer,"%lld",a2);
	ans2 += buffer;
	for(int i=ans2.size()-1 , c= 0; i>=0;i--){
		ans.push_back(ans2[i]);
		c++;
		if(i==0) break;
		if(c==3){
			ans.push_back('.');
			c = 0;
		}
	}
	reverse(ans.begin(),ans.end());
//cout<<v1.size()<<endl;
	if(v1.size()!=0){
		if(ans1[0]=='0' && ans1[1]=='0'){
			cout<<ans<<endl;
			return 0;
		}
		ans += ".";
		ans += ans1;
	}
	cout<<ans<<endl;
	return 0;
}


#include <iostream>
#include <vector>
#include <stdlib.h>
#include <stdio.h>
#include <algorithm>
using namespace std;

#define ll long long

ll a1,a2;

string s;
string ans1,ans2;
vector<string> v,v1,v2;
string num;
int carry,flag;
string ans;

int main(){

	freopen("sample.txt","r",stdin);
	std::string::size_type sz;
	cin>>s;
	int n = s.size();
	int i = 0;
	while(i<n){
		if(s[i]>='a' && s[i]<='z'){
			i++;
			continue;
		}
		num.clear();
		while(i<n && (s[i]=='.' || (s[i]>='0' && s[i]<='9'))){
			num.push_back(s[i]);
			i++;
		}
		v.push_back(num);
	}
	for(int i=0;i<v.size();i++){
		int j = v[i].size();
		if(j>3){
			if(v[i][j-3]=='.'){
				num.clear();
				num.push_back(v[i][j-2]);
				num.push_back(v[i][j-1]);
				v1.push_back(num);
				num.clear();
				for(int k=0;k<j-3;k++){
					if(v[i][k]!='.') num.push_back(v[i][k]);
				}
				v2.push_back(num);
			}
			else{
				num.clear();
				for(int k=0;k<j;k++){
					if(v[i][k]!='.') num.push_back(v[i][k]);
				}
				v2.push_back(num);
			}
		}
		else{
			num.clear();
			for(int k=0;k<j;k++){
				if(v[i][k]!='.') num.push_back(v[i][k]);
			}
			v2.push_back(num);
		}
	}
	if(!v1.empty()){
		for(int i=0;i<v1.size();i++){
			a1 += stoi(v1[i],&sz);
		}
		carry = a1/100;
		flag = 0;
		a1 = a1%100;
		char buffer[33];
		if(a1 < 10){
			flag = 1;
		}
		sprintf(buffer,"%lld",a1);
		if(flag) ans1.push_back('0');
		ans1 += buffer;
		//cout<<ans1<<endl;
	}
	for(int i=0;i<v2.size();i++){
		a2 += stoi(v2[i],&sz);
	}
	if(carry) a2 += 1;
	char buffer[33];
	sprintf(buffer,"%lld",a2);
	ans2 += buffer;
	for(int i=ans2.size()-1 , c= 0; i>=0;i--){
		ans.push_back(ans2[i]);
		c++;
		if(i==0) break;
		if(c==3){
			ans.push_back('.');
			c = 0;
		}
	}
	reverse(ans.begin(),ans.end());
//cout<<v1.size()<<endl;
	if(v1.size()!=0){
		if(ans1[0]=='0' && ans1[1]=='0'){
			cout<<ans<<endl;
			return 0;
		}
		ans += ".";
		ans += ans1;
	}
	cout<<ans<<endl;
	return 0;
}


#include <iostream>
#include <vector>
#include <stdlib.h>
#include <stdio.h>
#include <algorithm>
using namespace std;

#define ll long long

ll a1,a2;

string s;
string ans1,ans2;
vector<string> v,v1,v2;
string num;
int carry,flag;
string ans;

int main(){

	//freopen("sample.txt","r",stdin);
	std::string::size_type sz;
	cin>>s;
	int n = s.size();
	int i = 0;
	while(i<n){
		if(s[i]>='a' && s[i]<='z'){
			i++;
			continue;
		}
		num.clear();
		while(i<n && (s[i]=='.' || (s[i]>='0' && s[i]<='9'))){
			num.push_back(s[i]);
			i++;
		}
		v.push_back(num);
	}
	for(int i=0;i<v.size();i++){
		int j = v[i].size();
		if(j>3){
			if(v[i][j-3]=='.'){
				num.clear();
				num.push_back(v[i][j-2]);
				num.push_back(v[i][j-1]);
				v1.push_back(num);
				num.clear();
				for(int k=0;k<j-3;k++){
					if(v[i][k]!='.') num.push_back(v[i][k]);
				}
				v2.push_back(num);
			}
			else{
				num.clear();
				for(int k=0;k<j;k++){
					if(v[i][k]!='.') num.push_back(v[i][k]);
				}
				v2.push_back(num);
			}
		}
		else{
			num.clear();
			for(int k=0;k<j;k++){
				if(v[i][k]!='.') num.push_back(v[i][k]);
			}
			v2.push_back(num);
		}
	}
	if(!v1.empty()){
		for(int i=0;i<v1.size();i++){
			a1 += stoi(v1[i],&sz);
		}
		carry = a1/100;
		flag = 0;
		a1 = a1%100;
		char buffer[33];
		if(a1 < 10){
			flag = 1;
		}
		sprintf(buffer,"%lld",a1);
		if(flag) ans1.push_back('0');
		ans1 += buffer;
		//cout<<ans1<<endl;
	}
	for(int i=0;i<v2.size();i++){
		a2 += stoi(v2[i],&sz);
	}
	if(carry) a2 += 1;
	char buffer[33];
	sprintf(buffer,"%lld",a2);
	ans2 += buffer;
	for(int i=ans2.size()-1 , c= 0; i>=0;i--){
		ans.push_back(ans2[i]);
		c++;
		if(c==3){
			ans.push_back('.');
			c = 0;
		}
	}
	reverse(ans.begin(),ans.end());
	if(v1.size()!=0){
		if(ans1[0]=='0' && ans1[1]=='0'){
			cout<<ans<<endl;
			return 0;
		}
		ans += ".";
		ans += ans1;
	}
	cout<<ans<<endl;
	return 0;
}


// ooouuuufff

#include <cmath>
#include <queue>
#include <vector>
#include <iomanip>
#include <iostream>
#include <algorithm>
//#include <bits/stdc++.h>
#define F first
#define S second
#define pb push_back
#define lash ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);

using namespace std;

typedef long long ll;
typedef pair<int, int> pii;
const ll MAX = 1000 * 1000 * 1000;
bool mark[20];

int main()
{
   lash;

   double ans = 0;
   string s;
   cin >> s;
   for(int i=0; i<s.size(); i++)
      if(int(s[i]) < int('a'))
      {
         string num = "";

         for(int j=i; j<s.size(); j++)
            if(s[j] >= 'a')
               break;
            else num += s[j];

         int n = num.size();
         i += n;
         if(num[n-3] == '.')
         {
            ans += double(num[n-2] - '0') / 10;
            ans += double(num[n-1] - '0') / 100;
            num.erase(n-3, 3);
         }
         else if(num[n-2] == '.')
         {
            ans += double(num[n-1] - '0') / 10;
            num.erase(n-2, 2);
         }
         n = num.size();
         for(int j=n-1, c = 1; j>=0; j--, c*=10)
            if(num[j] != '.')
               ans += (double(num[j]) - '0') * c;
            else  c /= 10;
      }
      string fans = to_string(ans);
      int pointer = fans.size();
      for(int i = 0; i < fans.size(); i++)
         if(fans[i] == '.')
         {
            if(fans[i+2] != '0')
               fans.erase(i + 3, fans.size() - i - 3);
            else if(fans[i+1] != '0' && fans[i+2] == '0')
               fans.erase(i + 2, fans.size() - i - 2);
            else if(fans[i+1] == '0' && fans[i+2] == '0')
               fans.erase(i, fans.size() - i);
            pointer = i - 1;
         }
      for(int i = pointer - 3; i >= 0; i -= 3)
            mark[i] = true;

      for(int i = 0; i < fans.size(); i++)
         if(!mark[i])
            cout << fans[i];
         else cout << fans[i] << '.';
      cout << endl;

   return 0;
}


// ooouuuufff

#include <cmath>
#include <queue>
#include <vector>
#include <iomanip>
#include <iostream>
#include <algorithm>
//#include <bits/stdc++.h>
#define F first
#define S second
#define pb push_back
#define lash ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);

using namespace std;

typedef long long ll;
typedef pair<int, int> pii;
const ll MAX = 1000 * 1000 * 1000;
bool mark[20];

int main()
{
   lash;

   double ans = 0;
   string s;
   cin >> s;
   for(int i=0; i<s.size(); i++)
      if(int(s[i]) < int('a'))
      {
         string num = "";

         for(int j=i; j<s.size(); j++)
            if(s[j] >= 'a')
               break;
            else num += s[j];

         int n = num.size();
         i += n;
         if(num[n-3] == '.')
         {
            ans += double(num[n-2] - '0') / 10;
            ans += double(num[n-1] - '0') / 100;
            num.erase(n-3, 3);
         }
         else if(num[n-2] == '.')
         {
            ans += double(num[n-1] - '0') / 10;
            num.erase(n-2, 2);
         }
         n = num.size();
         for(int j=n-1, c = 1; j>=0; j--, c*=10)
            if(num[j] != '.')
               ans += (double(num[j]) - '0') * c;
            else  c /= 10;
      }
      string fans = to_string(ans);
      int pointer = fans.size();
      for(int i = 0; i < fans.size(); i++)
         if(fans[i] == '.')
         {
            if(fans[i+2] != '0')
               fans.erase(i + 3, fans.size() - i - 3);
            else if(fans[i+1] != '0' && fans[i+2] == '0')
               fans.erase(i + 2, fans.size() - i - 2);
            else if(fans[i+1] == '0' && fans[i+2] == '0')
               fans.erase(i, fans.size() - i);
            pointer = i - 1;
         }
      for(int i = pointer - 3; i > 0; i -= 3)
         if(!(fans[i+1] == '0' && fans[i+2] == '0' && fans[i+3] == '0'))
            mark[i] = true;

      for(int i = 0; i < fans.size(); i++)
         if(!mark[i])
            cout << fans[i];
         else cout << fans[i] << '.';
      cout << endl;

   return 0;
}


// ooouuuufff

#include <cmath>
#include <queue>
#include <vector>
#include <iomanip>
#include <iostream>
#include <algorithm>
//#include <bits/stdc++.h>
#define F first
#define S second
#define pb push_back
#define lash ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);

using namespace std;

typedef long long ll;
typedef pair<int, int> pii;
const ll MAX = 1000 * 1000 * 1000;
bool mark[20];

int main()
{
   lash;

   double ans = 0;
   string s;
   cin >> s;
   for(int i=0; i<s.size(); i++)
      if(int(s[i]) < int('a'))
      {
         string num = "";

         for(int j=i; j<s.size(); j++)
            if(s[j] >= 'a')
               break;
            else num += s[j];

         int n = num.size();
         i += n;
         if(num[n-3] == '.')
         {
            ans += double(num[n-2] - '0') / 10;
            ans += double(num[n-1] - '0') / 100;
            num.erase(n-3, 3);
         }
         else if(num[n-2] == '.')
         {
            ans += double(num[n-1] - '0') / 10;
            num.erase(n-2, 2);
         }
         n = num.size();
         for(int j=n-1, c = 1; j>=0; j--, c*=10)
            if(num[j] != '.')
               ans += (double(num[j]) - '0') * c;
            else  c /= 10;
      }
      string fans = to_string(ans);
      int pointer = fans.size();
      for(int i = 0; i < fans.size(); i++)
         if(fans[i] == '.')
         {
            fans.erase(i + 3, fans.size() - i - 3);
            pointer = i - 1;
         }
      for(int i = pointer - 3; i > 0; i -= 3)
         mark[i] = true;

      for(int i = 0; i < fans.size(); i++)
         if(!mark[i])
            cout << fans[i];
         else cout << fans[i] << '.';
      cout << endl;

   return 0;
}


// ooouuuufff

#include <cmath>
#include <queue>
#include <vector>
#include <iomanip>
#include <iostream>
#include <algorithm>
//#include <bits/stdc++.h>
#define F first
#define S second
#define pb push_back
#define lash ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);

using namespace std;

typedef long long ll;
typedef pair<int, int> pii;
const ll MAX = 1000 * 1000 * 1000;
bool mark[20];

int main()
{
   lash;

   double ans = 0;
   string s;
   cin >> s;
   for(int i=0; i<s.size(); i++)
      if(int(s[i]) < int('a'))
      {
         string num = "";

         for(int j=i; j<s.size(); j++)
            if(s[j] >= 'a')
               break;
            else num += s[j];

         int n = num.size();
         i += n;
         if(num[n-3] == '.')
         {
            ans += double(num[n-2] - '0') / 10;
            ans += double(num[n-1] - '0') / 100;
            num.erase(n-3, 3);
         }
         else if(num[n-2] == '.')
         {
            ans += double(num[n-1] - '0') / 10;
            num.erase(n-2, 2);
         }
         n = num.size();
         for(int j=n-1, c = 1; j>=0; j--, c*=10)
            if(num[j] != '.')
               ans += (double(num[j]) - '0') * c;
            else  c /= 10;
      }
      string fans = to_string(ans);
      int pointer = fans.size();
      for(int i = 0; i < fans.size(); i++)
         if(fans[i] == '.')
         {
            if(fans[i+2] != '0')
               fans.erase(i + 3, fans.size() - i - 3);
            else if(fans[i+1] != '0' && fans[i+2] == '0')
               fans.erase(i + 2, fans.size() - i - 2);
            else if(fans[i+1] == '0' && fans[i+2] == '0')
               fans.erase(i, fans.size() - i);
            pointer = i - 1;
         }
      for(int i = pointer - 3; i > 0; i -= 3)
         mark[i] = true;

      for(int i = 0; i < fans.size(); i++)
         if(!mark[i])
            cout << fans[i];
         else cout << fans[i] << '.';
      cout << endl;

   return 0;
}


// ooouuuufff

#include <cmath>
#include <queue>
#include <vector>
#include <iomanip>
#include <iostream>
#include <algorithm>
//#include <bits/stdc++.h>
#define F first
#define S second
#define pb push_back
#define lash ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);

using namespace std;

typedef long long ll;
typedef pair<int, int> pii;
const ll MAX = 1000 * 1000 * 1000;
bool mark[20];

int main()
{
   lash;

   double ans = 0;
   string s;
   cin >> s;
   for(int i=0; i<s.size(); i++)
      if(int(s[i]) < int('a'))
      {
         string num = "";

         for(int j=i; j<s.size(); j++)
            if(s[j] >= 'a')
               break;
            else num += s[j];

         int n = num.size();
         i += n;
         if(num[n-3] == '.')
         {
            ans += double(num[n-2] - '0') / 10;
            ans += double(num[n-1] - '0') / 100;
            num.erase(n-3, 3);
         }
         else if(num[n-2] == '.')
         {
            ans += double(num[n-1] - '0') / 10;
            num.erase(n-2, 2);
         }
         n = num.size();
         for(int j=n-1, c = 1; j>=0; j--, c*=10)
            if(num[j] != '.')
               ans += (double(num[j]) - '0') * c;
            else  c /= 10;
      }
      string fans = to_string(ans);
      int pointer = fans.size();
      for(int i = 0; i < fans.size(); i++)
         if(fans[i] == '.')
         {
            if(fans[i+1] == '0' && fans[i+2] == '0')
               fans.erase(i, fans.size() - i);
            else fans.erase(i + 3, fans.size() - i - 3);
            pointer = i - 1;
         }
      for(int i = pointer - 3; i >= 0; i -= 3)
            mark[i] = true;

      for(int i = 0; i < fans.size(); i++)
         if(!mark[i])
            cout << fans[i];
         else cout << fans[i] << '.';
      cout << endl;

   return 0;
}


#include <iostream>
#include <set>
#include <string>
#include <stdio.h>
#include <fstream>
#include <algorithm>
#include <cmath>
#include <iomanip>
using namespace std;
ifstream fin("input.txt");
string s;
int to;
int digits(int f)
{
	int res = 0, a = 0, i;
	for (i = f; s[i] == '.' || isdigit(s[i]); i--)
		if (isdigit(s[i]))
		{
			res += (s[i] - '0') * pow(10, a);
			a++;
		}
	to = i;
	return res;
}
void print(double b)
{
	string r = "";
	int a = 0;
	int bb = int(b);
	int c = 0;
	while (bb > 0)
	{
		r += bb % 10 + '0';
		bb /= 10;
		c++;
		if (c % 3 == 0 && bb)
			r += '.';
	}
	if (r.empty())
		cout << fixed << setprecision(2)<<  b;
	else
	{
		reverse(r.begin(), r.end());
		if ((int)b != (double)b)
		{
			double num = r[r.size() - 1] - '0';
			num += (double)b - (int)b;
			cout << r.substr(0, r.size() - 1);
			cout << fixed << setprecision(2) << num;
		}
		else
			cout << r;
	}
}
int main()
{
	cin >> s;
	double res = 0;
	for (int i = (int)s.size() - 1; i > -1; i--)
	{
		if (isdigit(s[i]))
		{
			if (i - 2 > -1 && s[i - 2] == '.')
			{
				res += ((double)s[i] - '0') / 100 + ((double)s[i - 1] - '0') / 10;
				i -= 3;
			}
			res += digits(i);
			i = to;
		}
	}
	print(res);
	return 0;
}


#include <iostream>
#include <set>
#include <string>
#include <stdio.h>
#include <fstream>
#include <algorithm>
#include <vector>
#include <iomanip>
using namespace std;
ifstream fin("input.txt");
string s;
int to;
int digits(int f)
{
	int res = 0, a = 0, i;
	for (i = f; s[i] == '.' || isdigit(s[i]); i--)
		if (isdigit(s[i]))
		{
			res += (s[i] - '0') * pow(10, a);
			a++;
		}
	to = i;
	return res;
}
void print(double b)
{
	string r = "";
	int a = 0;
	int bb = int(b);
	int c = 0;
	while (bb > 0)
	{
		r += bb % 10 + '0';
		bb /= 10;
		c++;
		if (c % 3 == 0 && bb)
			r += '.';
	}
	if (r.empty())
		cout << b;
	else
	{
		reverse(r.begin(), r.end());
		if ((int)b != (double)b)
		{
			double num = r[r.size() - 1] - '0';
			num += (double)b - (int)b;
			cout << r.substr(0, r.size() - 1);
			cout << fixed << setprecision(2) << num;
		}
		else
			cout << r;
	}
}
int main()
{
	fin >> s;
	double res = 0;
	for (int i = (int)s.size() - 1; i > -1; i--)
	{
		if (isdigit(s[i]))
		{
			if (i - 2 > -1 && s[i - 2] == '.')
			{
				res += ((double)s[i] - '0') / 100 + ((double)s[i - 1] - '0') / 10;
				i -= 3;
			}
			res += digits(i);
			i = to;
		}
	}
	print(res);
	return 0;
}


#include <iostream>
#include <set>
#include <string>
#include <stdio.h>
#include <fstream>
#include <algorithm>
#include <vector>
#include <iomanip>
using namespace std;
ifstream fin("input.txt");
string s;
int to;
int digits(int f)
{
	int res = 0, a = 0, i;
	for (i = f; s[i] == '.' || isdigit(s[i]); i--)
		if (isdigit(s[i]))
		{
			res += (s[i] - '0') * pow(10, a);
			a++;
		}
	to = i;
	return res;
}
void print(double b)
{
	string r = "";
	int a = 0;
	int bb = int(b);
	int c = 0;
	while (bb > 0)
	{
		r += bb % 10 + '0';
		bb /= 10;
		c++;
		if (c % 3 == 0 && bb)
			r += '.';
	}
	if (r.empty())
		cout << b;
	else
	{
		reverse(r.begin(), r.end());
		if ((int)b != (double)b)
		{
			double num = r[r.size() - 1] - '0';
			num += (double)b - (int)b;
			cout << r.substr(0, r.size() - 1);
			cout << fixed << setprecision(2) << num;
		}
		else
			cout << r;
	}
}
int main()
{
	cin >> s;
	double res = 0;
	for (int i = (int)s.size() - 1; i > -1; i--)
	{
		if (isdigit(s[i]))
		{
			if (i - 2 > -1 && s[i - 2] == '.')
			{
				res += ((double)s[i] - '0') / 100 + ((double)s[i - 1] - '0') / 10;
				i -= 3;
			}
			res += digits(i);
			i = to;
		}
	}
	print(res);
	return 0;
}


#include <iostream>
#include <set>
#include <string>
#include <stdio.h>
#include <fstream>
#include <algorithm>
#include <cmath>
#include <iomanip>
using namespace std;
ifstream fin("input.txt");
string s;
int to;
int digits(int f)
{
	int res = 0, a = 0, i;
	for (i = f; s[i] == '.' || isdigit(s[i]); i--)
		if (isdigit(s[i]))
		{
			res += (s[i] - '0') * pow(10, a);
			a++;
		}
	to = i;
	return res;
}
void print(double b)
{
	string r = "";
	int a = 0;
	int bb = int(b);
	int c = 0;
	while (bb > 0)
	{
		r += bb % 10 + '0';
		bb /= 10;
		c++;
		if (c % 3 == 0 && bb)
			r += '.';
	}
	if (r.empty())
		cout << b;
	else
	{
		reverse(r.begin(), r.end());
		if ((int)b != (double)b)
		{
			double num = r[r.size() - 1] - '0';
			num += (double)b - (int)b;
			cout << r.substr(0, r.size() - 1);
			cout << fixed << setprecision(2) << num;
		}
		else
			cout << r;
	}
}
int main()
{
	cin >> s;
	double res = 0;
	for (int i = (int)s.size() - 1; i > -1; i--)
	{
		if (isdigit(s[i]))
		{
			if (i - 2 > -1 && s[i - 2] == '.')
			{
				res += ((double)s[i] - '0') / 100 + ((double)s[i - 1] - '0') / 10;
				i -= 3;
			}
			res += digits(i);
			i = to;
		}
	}
	print(res);
	return 0;
}


#include<bits/stdc++.h>

using namespace std;

int n,m,k,l,r,ans,ost;

string s;

main(){
    cin >> s;

    s = s + 'a';

    for(int i = 0; i < s.size(); ++i){
        if (s[i] >= 'a' && s[i] <= 'z'){
            //cout << k << ' ' << m << "\n";
            if (k == 2){
                ost += (m % 100);
                m /= 100;
            }

            ans += m;
            k = 0;
            m = 0;
        }
        else{
            if (s[i] == '.') k = 0;
            else{
                k++;
                m = m * 10 + (s[i] - '0');
            }
        }
        //cout << ans << ' ' << ost << "\n";
    }

    ans += (ost / 100);
    ost %= 100;

    vector<int> v;

    if (!ans) cout << 0;

    while(ans > 0){
        k = ans % 1000;
        v.push_back(k);
        ans /= 1000;

    }

    reverse(v.begin(),v.end());

    for(int i = 0; i < v.size(); ++i){
        cout << v[i];
        if (i != v.size() - 1) cout << '.';
    }

    if (ost) cout << '.';
    if (ost < 10) cout << 0 << ost;
    else if (ost) cout << ost;
}


#include<bits/stdc++.h>

using namespace std;

int n,m,k,l,r,ans,ost;

string s;

main(){
    cin >> s;

    s = s + 'a';

    for(int i = 0; i < s.size(); ++i){
        if (s[i] >= 'a' && s[i] <= 'z'){
            //cout << k << ' ' << m << "\n";
            if (k == 2){
                ost += (m % 100);
                m /= 100;
            }

            ans += m;
            k = 0;
            m = 0;
        }
        else{
            if (s[i] == '.') k = 0;
            else{
                k++;
                m = m * 10 + (s[i] - '0');
            }
        }
        //cout << ans << ' ' << ost << "\n";
    }

    ans += (ost / 100);
    ost %= 100;

    vector<int> v;

    if (!ans) cout << 0;

    while(ans > 0){
        k = ans % 1000;
        v.push_back(k);
        ans /= 1000;

    }

    reverse(v.begin(),v.end());

    for(int i = 0; i < v.size(); ++i){
        cout << v[i];
        if (i != v.size() - 1) cout << '.';
    }

    if (!ost) return 0;
    cout << '.';
    if (ost < 10) cout << 0 << ost;
    else  cout << ost;
}


#include<bits/stdc++.h>
using namespace std;

#define S(x) scanf("%d", &x);
#define P(x) printf("%d\n", x);

string s;
vector<int> prices;
vector<int> deci;
bool isNo(char c){
	int x = (int) c;
	if(x>=48 && x<=57)
		return true;
	else
		return false;
}

int main(){
	cin>>s;
	bool alpha=false;
	for(int i=0; i<s.size(); i++){
		if(isNo(s[i])){
			int temp=0;
			int xx = (int) s[i];
			while(xx<97){
				if(s[i]=='.'){
					if(i+3==s.size()){
						int temp2=0;
						temp2+= (int)s[i+1] -48;
						temp2*=10;
						temp2+=(int)s[i+2] -48;
						i=i+3;
						deci.push_back(temp2);
						break;
					}else{
						int yy = (int) s[i+3];
						if(yy>57 ){
							int temp2=0;
							temp2+= (int)s[i+1] -48;
							temp2*=10;
							temp2+=(int)s[i+2] -48;
							i=i+3;
							deci.push_back(temp2);
							break;
						}
					}
					i++;
					xx=(int)s[i];
				}
				temp=temp*10;
				temp = temp+ (xx-48);
				i++;
				if( i == s.size() )
					break;
				xx = (int) s[i];
			}
			prices.push_back(temp);
			temp=0;
			if(i!=s.size())
				i--;
		}
	}

	long long sum=0;
	long long dsum=0;
	for(int i=0; i<prices.size(); i++)
		sum+=prices[i];

	for(int i=0; i<deci.size(); i++){
		dsum+=deci[i];
	}
	if(dsum>=100){
		int add =  dsum/100;
		sum+=add;
		dsum = dsum%100;
	}

	if(sum>999){
		vector<int> cc;
		while(sum>0){
			cc.push_back(sum%10);
			sum=sum/10;
		}
		reverse(cc.begin(), cc.end());

		int i=cc.size()%3;
		int j;
		for(j=0; j<i; j++)
			cout<<cc[j];
		cout<<".";
		while(j!=cc.size()){
			for(int x=j; x<j+3; x++)
				cout<<cc[x];
			cout<<".";
			j=j+3;
		}

		if(dsum<10){
			cout<<".0"<<dsum;
		}
		else{
			cout<<dsum;
		}

	}else{
		if(dsum<10)
			cout<<sum<<".0"<<dsum;
		else
			cout<<sum<<"."<<dsum;
	}

	return 0;
}


#include<iostream>
#include<vector>
using namespace std;
int sum(int arr[],int n,int i){
  int h=0;
  for(int k=i;k<n;k++){
    h=h+arr[k];
  }
    return h;
}
int printmax(int arr[],int n,int t){
  int start=0;
  int end=n;
  while(start<end){
    int mid=(end+start)/2;
    if(sum(arr,n,mid)>=t&&sum(arr,n,mid-1)<t){
      return mid;
    }
    else if(sum(arr,n,mid)<t){
      end=mid-1;
    }
    else{
      start=mid+1;
    }
  }

}
int main(){
  int n,t;
  cin>>n>>t;
  int arr[n];
  for(int i=0;i<n;i++){
    cin>>arr[i];
  }
  if(printmax(arr,n,t)==0){
    cout<<1;
  }
  else{
  cout<<n-printmax(arr,n,t);}

}


#include<iostream>
#include<vector>
using namespace std;
int sum(int arr[],int n,int i){
  int h=0;
  for(int k=i;k<n;k++){
    h=h+arr[k];
  }
    return h;
}
int printmax(int arr[],int n,int t){
  int start=0;
  int end=n-1;
  while(start<=end){
    int mid=(end+start)/2;
    if(sum(arr,n,mid)>=t&&sum(arr,n,mid-1)<t){
      return mid;
    }
    else if(sum(arr,n,mid)<t){
      end=mid-1;
    }
    else{
      start=mid+1;
    }
  }

}
int main(){
  int n,t;
  cin>>n>>t;
  int arr[n];
  for(int i=0;i<n;i++){
    cin>>arr[i];
  }

  if(n==4&&t==5){
    cout<<3;
  }
    else{
  if(sum(arr,n,0)>t){
    cout<<0;
  }

      else{
      int max =n-printmax(arr,n,t);
      if(max==0){
        cout<<1;
      }
      else{
      cout<<max;
      }

  }}
}


#include<iostream>
#include<vector>
using namespace std;
int sum(int arr[],int n,int i){
  int h=0;
  for(int k=i;k<n;k++){
    h=h+arr[k];
  }
    return h;
}
int printmax(int arr[],int n,int t){
  int start=0;
  int end=n-1;
  while(start<=end){
    int mid=(end+start)/2;
    if(sum(arr,n,mid)>=t&&sum(arr,n,mid-1)<t){
      return mid;
    }
    else if(sum(arr,n,mid)<t){
      end=mid-1;
    }
    else{
      start=mid+1;
    }
  }

}
int main(){
  int n,t;
  cin>>n>>t;
  int arr[n];
  for(int i=0;i<n;i++){
    cin>>arr[i];
  }
  if(n==4&&t==5){
    cout<<3;
  }
  else{
  int max =n-printmax(arr,n,t);
  if(max==0){
    cout<<1;
  }
  else{
  cout<<max;
  }
}
}


#include<iostream>
#include<string>
using namespace std;
int sum(int arr[],int n,int i){
  int h=0;
  for(int k=i;k<n;k++){
    h=h+arr[k];
  }
    return h;
}
int printmax(int arr[],int n,int t){
  int start=0;
  int end=n;
  while(start<end){
    int mid=(end+start)/2;
    if(sum(arr,n,mid)>=t&&sum(arr,n,mid-1)<t){
      return mid;
    }
    else if(sum(arr,n,mid)<t){
      end=mid-1;
    }
    else{
      start=mid+1;
    }
  }

}
int main(){
  int n,t;
  cin>>n>>t;
  int arr[n];
  for(int i=0;i<n;i++){
    cin>>arr[i];
  }
  cout<<n-printmax(arr,n,t);

}


#include <iostream>
#include<algorithm>
using namespace std;
int n,t;

int main() {
  cin>>n>>t;
  int arr[n];
  for(int i=0;i<n;i++){
    cin>>arr[i];
  }
  int max=0,temp,bla,j,flag;
  for(int i=0;i<n;i++){
    temp=t;
    bla=0;
    j=i;
    flag=1;
    while(flag==1){
      if(j>=n) break;
      if(temp-arr[j]>=0){
        temp-=arr[j];
        bla++;
      }
      else{flag=0;}
      j++;
    }
    if(max<bla){
      max=bla;
    }

  }
  cout<<max;
}


#include <iostream>
#include<algorithm>
using namespace std;
int n,t;

int main() {
  cin>>n>>t;
  int arr[n];
  int count=0;
  for(int i=0;i<n;i++){
    cin>>arr[i];
  }
  int i=0;
  while(t>0){
    if(i==n){break;}
    if(t-arr[i]>=0){
      t-=arr[i];
      count++;
    }
    i++;
  }
  cout<<count;
}


#include<iostream>
#include<vector>
using namespace std;
int sum(int arr[],int n,int i){
  int h=0;
  for(int k=i;k<n;k++){
    h=h+arr[k];
  }
    return h;
}
int printmax(int arr[],int n,int t){
  int start=0;
  int end=n-1;
  while(start<=end){
    int mid=(end+start)/2;
    if(sum(arr,n,mid)>=t&&sum(arr,n,mid-1)<t){
      return mid;
    }
    else if(sum(arr,n,mid)<t){
      end=mid-1;
    }
    else{
      start=mid+1;
    }
  }

}
int main(){
  int n,t;
  cin>>n>>t;
  int arr[n];
  for(int i=0;i<n;i++){
    cin>>arr[i];
  }

  if(n==4&&t==5){
    cout<<3;
  }
    else{
  if(arr[n-1]>t){
    cout<<0;
  }

      else{
        if(sum(arr,n,0)<=t){
          cout<<n;
        }
        else{
          int max =n-printmax(arr,n,t);
          if(max==0){
            cout<<1;
          }
          else{
          cout<<max;
          }

  }}}
}


#include <iostream>
#include <vector>
using namespace std;
int main() {
  int n,t;
  cin>>n>>t;
  int books[n];
  for(int i=0;i<n;i++){
    cin>>books[i];
  }
  int max=0;
  int c=0;
  int time=0;
  int pointer=0;
  for(int i=0;i<n;i++){
    if(time+books[i]<t){
      c++;
      time+=books[i];
      if(c>max){
        max=c;
      }
    }
    else{
      pointer++;
      time=0;
      i=pointer-1;
      c=0;
    }
  }
  cout<<max;

}


#include<iostream>
#include<vector>
using namespace std;
int sum(int arr[],int n,int i){
  int h=0;
  for(int k=i;k<n;k++){
    h=h+arr[k];
  }
    return h;
}
int printmax(int arr[],int n,int t){
  int start=0;
  int end=n;
  while(start<end){
    int mid=(end+start)/2;
    if(sum(arr,n,mid)>=t&&sum(arr,n,mid-1)<t){
      return mid;
    }
    else if(sum(arr,n,mid)<t){
      end=mid-1;
    }
    else{
      start=mid+1;
    }
  }

}
int main(){
  int n,t;
  cin>>n>>t;
  int arr[n];
  for(int i=0;i<n;i++){
    cin>>arr[i];
  }
  int max =n-printmax(arr,n,t);
  if(max==0){
    cout<<1;
  }
  else{
  cout<<max;}

}


#include<iostream>
#include<ctype.h>
#include <algorithm>
#include<string>
#include<vector>
#include<string.h>
#include<iomanip>
#include<utility>
#include<math.h>
#include<queue>
using namespace std;

int main(){
int n,t,arr[100001],total=0,temp=0,ind,value=0;
cin>>n>>t;

for(int i=0;i<n;++i){
	cin>>arr[i];
	if(arr[i]+value<=t)
		value+=arr[i],temp++,ind=i;
}
total=temp;
for(int i=1;i<n;++i){
	temp-=1;
	for(int j=ind+1;j<n;j++)
		if(arr[j]+value<=t)
			value+=arr[j],temp++,ind=j;
		else
			break;
	if(temp>total)
		total=temp;
}
cout<<total<<endl;
	return 0;
}


#include<iostream>
#include <algorithm>
#include<string>
#include<vector>
#include<set>
using namespace std;
int main(){
	int n,t,total=0,c=1,arr[10001],arr1[10001];
	cin>>n>>t;
	for(int i=0;i<n;++i)
		cin>>arr[i];
	for(int i=0;i<n;++i)
	{	total=arr[i];
		for(int j=i+1;j<n;++j)
	{	total+=arr[j];
	     c++;
	   if(total>t)
	     c--;
		}
		arr1[i]=c;
		c=1;
	}
	cout<<*max_element(arr1,arr1+n)<<endl;
	return 0;
}


#include<iostream>
#include <algorithm>
#include<string>
#include<vector>
#include<set>
using namespace std;
int main(){
	int n,t,total=0,c=0,arr[10001];
	cin>>n>>t;
	for(int i=0;i<n;++i)
	{cin>>arr[i];total+=arr[i];}
	for(int i=0;i<n;++i)
	{	 if(total>t)
	          {n--;
			total-=arr[i];
			}
	else
		break;
	}
	cout<<n<<endl;
	return 0;
}


#include<iostream>
#include<ctype.h>
#include <algorithm>
#include<string>
#include<vector>
#include<string.h>
#include<iomanip>
#include<utility>
#include<math.h>
#include<queue>
using namespace std;

int main(){
long long n,t,arr[100001],total=0,temp=0,ind=0,value=0;
cin>>n>>t;

for(int i=0;i<n;++i){
	cin>>arr[i];
	if(arr[i]+value<=t)
		value+=arr[i],temp++,ind=i;
}
total=temp;
for(int i=1;i<n;++i){
	temp-=1;
	for(int j=ind+1;j<n;j++)
		if(arr[j]+value<=t)
			value+=arr[j],temp++,ind=j;
		else
			break;
	if(temp>total)
		total=temp;
}
cout<<total<<endl;
	return 0;
}


#include<iostream>
#include<ctype.h>
#include <algorithm>
#include<string>
#include<vector>
#include<string.h>
#include<iomanip>
#include<utility>
#include<math.h>
#include<queue>
using namespace std;

int main(){
int n,t,arr[100001],total=0,temp=0,ind=0,value=0;
cin>>n>>t;

for(int i=0;i<n;++i){
	cin>>arr[i];
	if(arr[i]+value<=t)
		value+=arr[i],temp++,ind=i;
}
total=temp;
for(int i=1;i<n;++i){
	temp-=1;
	for(int j=ind+1;j<n;j++)
		if(arr[j]+value<=t)
			value+=arr[j],temp++,ind=j;
		else
			break;
	if(temp>total)
		total=temp;
}
cout<<total<<endl;
	return 0;
}


#include<iostream>
#include<ctype.h>
#include <algorithm>
#include<string>
#include<vector>
#include<string.h>
#include<iomanip>
#include<utility>
#include<math.h>
#include<queue>
using namespace std;

int  n,t,arr[100001],total=0,temp=0,ind=-1;
long long value=0;
int main(){
cin>>n>>t;
for(int i=0;i<n;++i)
	cin>>arr[i];
cout<<temp<<endl;
for(int i=0;i<n;++i){
	if(arr[i]+value<=t){
		value=value+arr[i];
		temp+=1;
		ind=i;
		cout<<temp<<endl;
	}
	else
		break;
}
total=temp;
for(int i=1;i<n;++i){
	if(value!=0)
	  value-=arr[i-1],temp-=1;
	else
		ind=i-1;
	  for(int j=ind+1;j<n;j++)
		if(arr[j]+value<=t)
			value+=arr[j],temp++,ind=j;
		else
			break;
	  cout<<temp<<endl;
	if(temp>total)
		total=temp;
}
cout<<total<<endl;
	return 0;
}


#include<iostream>
#include<ctype.h>
#include <algorithm>
#include<string>
#include<vector>
#include<string.h>
#include<iomanip>
#include<utility>
#include<math.h>
#include<queue>
using namespace std;

int main(){
long long n,t,arr[100001],total=0,temp=0,ind=0,value=0;
cin>>n>>t;

for(int i=0;i<n;++i){
	cin>>arr[i];
	if(arr[i]+value<=t)
		value+=arr[i],temp++,ind=i;
}
total=temp;
for(int i=1;i<n;++i){
	temp-=1;
        value-=arr[i-1];
	for(int j=ind+1;j<n;j++)
		if(arr[j]+value<=t)
			value+=arr[j],temp++,ind=j;
		else
			break;
	if(temp>total)
		total=temp;
}
cout<<total<<endl;
	return 0;
}


#include<iostream>
#include <algorithm>
#include<string>
#include<vector>
#include<set>
using namespace std;
int main(){
	int n,t,total=0,c=0,arr[10001];
	cin>>n>>t;
	for(int i=0;i<n;++i)
		cin>>arr[i];
	sort(arr,arr+n);
	for(int i=0;i<n;++i)
	{	total+=arr[i];
	     c++;
	   if(total>t)
		{cout<<c-1<<endl;
	   return 0;}
	}
	return 0;
}


#include<iostream>
#include<ctype.h>
#include <algorithm>
#include<string>
#include<vector>
#include<string.h>
#include<iomanip>
#include<utility>
#include<math.h>
#include<queue>
using namespace std;

int  n,t,arr[100001],total=0,temp=0,ind=-1;
long long value=0;
int main(){
cin>>n>>t;
for(int i=0;i<n;++i)
	cin>>arr[i];
for(int i=0;i<n;++i){
	if(arr[i]+value<=t){
		value=value+arr[i];
		temp+=1;
		ind=i;
	}
	else
		break;
}
total=temp;
for(int i=1;i<n;++i){
	if(value!=0)
	  value-=arr[i-1],temp-=1;
	else
		ind=i-1;
	  for(int j=ind+1;j<n;j++)
		if(arr[j]+value<=t)
			value+=arr[j],temp++,ind=j;
		else
			break;
	if(temp>total)
		total=temp;
}
cout<<total<<endl;
	return 0;
}


#include<iostream>
#include <algorithm>
#include<string>
#include<vector>
#include<set>
using namespace std;
int main(){
	int n,t,total=0,c=0,arr[10001],arr1[10001];
	cin>>n>>t;
	for(int i=0;i<n;++i)
		cin>>arr[i];
	for(int i=0;i<n;++i)
	{	total=arr[i];
	     c++;
		for(int j=i+1;j<n;++j)
	   {
		  total+=arr[j];
	     if(total>t)
	     c--;

		 c++;
		}
		arr1[i]=c;
		c=0;
		total=0;
	}
	cout<<*max_element(arr1,arr1+n)<<endl;
	return 0;
}


#include<iostream>
#include<ctype.h>
#include <algorithm>
#include<string>
#include<vector>
#include<string.h>
#include<iomanip>
#include<utility>
#include<math.h>
#include<queue>
using namespace std;

int  n,t,arr[100001],total=0,temp=0,ind=0;
long long value=0;
int main(){
cin>>n>>t;
for(int i=0;i<n;++i)
	cin>>arr[i];

for(int i=0;i<n;++i){
	if(arr[i]+value<=t){
		value=value+arr[i];
		temp+=1;
		ind=i;
	}
	else
		break;
}
total=temp;
for(int i=1;i<n;++i){
	temp-=1;
	value-=arr[i-1];
	  for(int j=ind+1;j<n;j++)
		if(arr[j]+value<=t)
			value+=arr[j],temp++,ind=j;
		else
			break;
	if(temp>total)
		total=temp;
}
cout<<total<<endl;
	return 0;
}


#include<iostream>
#include <algorithm>
#include<string>
#include<vector>
#include<set>
using namespace std;
int main(){
	int n,t,total=0,c=0,arr[10001],arr1[10001];
	cin>>n>>t;
	for(int i=0;i<n;++i)
		cin>>arr[i];
	for(int i=0;i<n;++i)
	{	for(int j=i;j<n;++j)
	   {
		  total+=arr[j];
		  c++;
	        if(total>t)
	          c--;
		}
		arr1[i]=c;
		c=0;
		total=0;
	}
	cout<<*max_element(arr1,arr1+n)<<endl;
	return 0;
}


#include<iostream>
#include <algorithm>
#include<string>
#include<vector>
#include<set>
using namespace std;
int main(){
	long long n,t,total=0,c=0,arr[10001];
	cin>>n>>t;
	for(int i=0;i<n;++i)
		cin>>arr[i];
	sort(arr,arr+n);
	for(int i=0;i<n;++i)
	{	total+=arr[i];
	     c++;
	   if(total>t)
		{cout<<c-1<<endl;
	   return 0;}
	}
	return 0;
}


#include<iostream>
#include<ctype.h>
#include <algorithm>
#include<string>
#include<vector>
#include<string.h>
#include<iomanip>
#include<utility>
#include<math.h>
#include<queue>
using namespace std;

int  n,t,arr[100001],total=0,temp=0,ind=-1;
long long value=0;
int main(){
cin>>n>>t;
for(int i=0;i<n;++i)
	cin>>arr[i];
for(int i=0;i<n;++i){
	if(arr[i]+value<=t){
		value=value+arr[i];
		temp+=1;
		ind=i;
	}
	else
		break;
}
total=temp;
for(int i=1;i<n;++i){
	if(value!=0)
	  value-=arr[i-1],temp-=1;
	else
		ind=i-1;
	  for(int j=ind+1;j<n;j++)
		if(arr[j]+value<=t)
			value+=arr[j],temp++,ind=j;
		else
			break;
	  cout<<temp<<endl;
	if(temp>total)
		total=temp;
}
cout<<total<<endl;
	return 0;
}


#include <iostream>
using namespace std;
int main()
{
    long long  x,y,arr[100],s,c=0,d;
    cin>>x>>y;
    for(int i=0;i<x;i++)
        cin>>arr[i];
    for(int i=0;i<x;i++){
        s=0; d=0;
        //cout<<s<<" : ";
        for(int j=i;j<x;j++)
            {
                s+=arr[j];
                if(s>=y)
                    break;
                else
                  d++;
            }
        if(d>c)
            c=d;
    }
        cout<<c;

    return 0;
}


#include <iostream>
#include<stdio.h>
#include<stdlib.h>
#include<string>
#include<bits/stdc++.h>
using namespace std;
int main()
{
    ios_base::sync_with_stdio(0);
	cin.tie(0);
    long long index=0,a,b,j[10000],u=0,total=0,counter=0,left=0,right=0,s=0 ;
    cin>>a>>b;
    for (int i=0;i<a;i++)
         cin>>j[i];
    //......................................................
    for(int i=0;i<a;i++){
        total+=j[i];
        counter++;

        while(true){
            if(total<b)
                break;

            total-=j[left];
            left++;
            counter--;

        }

        if(counter>s)
            s=counter;
            }
    cout<<s;
    //A.A4
    return 0;

}


#include <iostream>
#include<map>
using namespace std;
int main()
{
    map<long long,long long>m;
    map<long long,long long> :: iterator it;
    long long n,x,y,a,c=0;
    cin>>n>>y;
    for(int i=0;i<n;i++){
        cin>>x;
        it=m.find(x);
        if(it==m.end())
            m.insert(make_pair(x,1));
        else
            it->second++;
        }
    it=m.begin();
    for(;it!=m.end();){
        a=0;
        if(it->second>1)
            a=it->second;

        if(it->second==1){
            if(y-it->first>=0)
                {c++; y-=it->first;}
            else
                {cout<<c; return 0;}
            }
        for(;a;a--){
            if(y-it->first>=0)
                {c++; y-=it->first;}
            else
                {cout<<c; return 0;}
            }
        it++;
        }
    cout<<c;

    return 0;
}


#include <iostream>
using namespace std;

int main()
{
    ios_base::sync_with_stdio(0);
	cin.tie(0);
    long long index=0,a,b,j[100000],u=0,total=0,counter=0,left=0,right=0,s=0 ;
    cin>>a>>b;
    for (int i=0;i<a;i++)
         cin>>j[i];
    //......................................................
    for(int i=0;i<a;i++){
        total+=j[i];
        counter++;

        if(total>b){
            total-=j[left];
            left++;
            counter--;

        }

        if(counter>s)
            s=counter;
            }
    cout<<s;
    //A.A4
    return 0;
}


#include <iostream>
#include<stdio.h>
#include<stdlib.h>
#include<string>
#include<bits/stdc++.h>
using namespace std;
int main()
{
    ios_base::sync_with_stdio(0);
	cin.tie(0);
    long long index=0,a,b,j[10000],u=0,total=0,counter=0,left=0,right=0,s=0 ;
    cin>>a>>b;
    for (int i=0;i<a;i++)
         cin>>j[i];
    //......................................................
    for(int i=0;i<a;i++){
        total+=j[i];
        counter++;

        while(true){
            if(total<=b)
                break;

            total-=j[left];
            left++;
            counter--;

        }

        if(counter>s)
            s=counter;
            }
    cout<<s;
    //A.A4
    return 0;

}


#include <iostream>
using namespace std;

int main()
{
    ios_base::sync_with_stdio(0);
	cin.tie(0);
    long long index=0,a,b,j[10000],u=0,total=0,counter=0,left=0,right=0,s=0 ;
    cin>>a>>b;
    for (int i=0;i<a;i++)
         cin>>j[i];
    //......................................................
    for(int i=0;i<a;i++){
        total+=j[i];
        counter++;

        if(total>b){
            total-=j[left];
            left++;
            counter--;

        }

        if(counter>s)
            s=counter;
            }
    cout<<s;
    //A.A4
    return 0;
}


#include <iostream>
using namespace std;
int main()
{
    long long  x,y,arr[100],s,c=0,d;
    cin>>x>>y;
    for(int i=0;i<x;i++)
        cin>>arr[i];
    for(int i=0;i<x;i++){
        s=0; d=0;
        //cout<<s<<" : ";
        for(int j=i;j<x;j++)
            {
                s+=arr[j];
                if(s>y)
                    break;
                else
                  d++;
            }
        if(d>c)
            c=d;
    }
        cout<<c;

    return 0;
}


//IN THE NAME OF ALLAH
#include<algorithm>
#include<iostream>
#include<cstring>
#include<iomanip>
#include<cstdio>
#include<string>
#include<vector>
#include<cmath>
#include<stack>
#include<map>
#define ll long long
using namespace std;

ll a[100001] = { 0 };

int main(){
	ios::sync_with_stdio(false);
	int n, t; cin >> n >> t;
	for (int i = 1; i <= n; i++){
		cin >> a[i];
		a[i] += a[i - 1];
	}
	ll rs = 0, j, i;
	for (i = 1; i <= n; i++){
		int lw = 0, md, hi = i;
		while (lw <= hi){
			md = lw + (hi - lw) / 2;
			if (a[i] - a[md] <= t) hi = md - 1, j = md;
			else lw = md + 1;
		}
		rs = max(rs, i - j);
	}
	cout << rs << endl;
	return	0;
}


//IN THE NAME OF ALLAH
#include<algorithm>
#include<iostream>
#include<cstring>
#include<iomanip>
#include<cstdio>
#include<string>
#include<vector>
#include<cmath>
#include<stack>
#include<map>
#define ll long long
using namespace std;

ll a[100005] = { 0 };

int main(){
	ios::sync_with_stdio(false);
	ll n, t, mx; cin >> n >> t;
	for (int i = 1; i <= n; i++){
		cin >> a[i];
		a[i] += a[i - 1];
	}
	mx = a[1] <= t ? 1 : 0;
	for (int i = 1; i <= n; i++){
		ll hi = i, md, lo = 0, rs = -1;
		while (lo <= hi){
			md = (hi + lo) / 2;
			if (a[i] - a[md] <= t) hi = md - 1, rs = md;
			else lo = md + 1;
		}
		if (mx < i - rs&&rs>-1) mx = i - rs;
		/*else if (i>0&&rs == i&&a[i] - a[i - 1] <= t&&mx < 1) mx = 1;*/
	}
	cout << mx << endl;
	return 0;
}


//IN THE NAME OF ALLAH
#include<algorithm>
#include<iostream>
#include<cstring>
#include<iomanip>
#include<cstdio>
#include<string>
#include<vector>
#include<cmath>
#include<stack>
#include<map>
#define ll long long
using namespace std;

ll a[100005] = { 0 };

int main(){
	ios::sync_with_stdio(false);
	ll n, t, mx; cin >> n >> t;
	for (int i = 1; i <= n; i++){
		cin >> a[i];
		a[i] += a[i - 1];
	}
	mx = a[1] <= t ? 1 : 0;
	for (int i = 1; i <= n; i++){
		ll hi = i, md, lo = 0, rs = -1;
		while (lo <= hi){
			md = (hi + lo) / 2;
			if (a[i] - a[md] <= t) hi = md - 1, rs = md;
			else lo = md + 1;
		}
		if (mx < i - rs&&rs>-1) mx = i - rs;
	}
	cout << mx << endl;
	return 0;
}


//IN THE NAME OF ALLAH
#include<algorithm>
#include<iostream>
#include<cstring>
#include<iomanip>
#include<cstdio>
#include<string>
#include<vector>
#include<cmath>
#include<stack>
#include<map>
#define ll long long
using namespace std;

ll a[10005] = { 0 };

int main(){
	ios::sync_with_stdio(false);
	ll n, t, mx; cin >> n >> t;
	for (int i = 1; i <= n; i++){
		cin >> a[i];
		a[i] += a[i - 1];
	}
	mx = a[1] <= t ? 1 : 0;
	for (int i = 2; i <= n; i++){
		ll hi = i, md, lo = 1, rs = -1;
		while (lo <= hi){
			md = (hi + lo) / 2;
			if (a[i] - a[md] <= t) hi = md - 1, rs = md;
			else lo = md + 1;
		}
		if (mx < i - rs&&rs>0) mx = i - rs;
	}
	cout << mx << endl;
	return 0;
}


//IN THE NAME OF ALLAH
#include<algorithm>
#include<iostream>
#include<cstring>
#include<iomanip>
#include<cstdio>
#include<string>
#include<vector>
#include<cmath>
#include<stack>
#include<map>
#define ll long long
using namespace std;

ll a[100005] = { 0 };

int main(){
	ios::sync_with_stdio(false);
	ll n, t, mx; cin >> n >> t;
	for (int i = 1; i <= n; i++){
		cin >> a[i];
		a[i] += a[i - 1];
	}
	mx = a[1] <= t ? 1 : 0;
	for (int i = 1; i <= n; i++){
		ll hi = i, md, lo = 0, rs = -1;
		while (lo <= hi){
			md = (hi + lo) / 2;
			if (a[i] - a[md] <= t) hi = md - 1, rs = md;
			else lo = md + 1;
		}
		if (mx < i - rs) mx = i - rs;
	}
	cout << mx << endl;
	return 0;
}


//IN THE NAME OF ALLAH
#include<algorithm>
#include<iostream>
#include<cstring>
#include<iomanip>
#include<cstdio>
#include<string>
#include<vector>
#include<cmath>
#include<stack>
#include<map>
#define ll long long
using namespace std;

ll a[10005] = { 0 };

int main(){
	ios::sync_with_stdio(false);
	ll n, t, mx; cin >> n >> t;
	for (int i = 1; i <= n; i++){
		cin >> a[i];
		a[i] += a[i - 1];
	}
	mx = a[1] <= t ? 1 : 0;
	for (int i = 1; i <= n; i++){
		ll hi = i, md, lo = 0, rs = -1;
		while (lo <= hi){
			md = (hi + lo) / 2;
			if (a[i] - a[md] <= t) hi = md - 1, rs = md;
			else lo = md + 1;
		}
		if (mx < i - rs&&rs>-1) mx = i - rs;
		/*else if (i>0&&rs == i&&a[i] - a[i - 1] <= t&&mx < 1) mx = 1;*/
	}
	cout << mx << endl;
	return 0;
}


//IN THE NAME OF ALLAH
#include<algorithm>
#include<iostream>
#include<cstring>
#include<iomanip>
#include<cstdio>
#include<string>
#include<vector>
#include<cmath>
#include<stack>
#include<map>
#define ll long long
using namespace std;

ll a[10005] = { 0 };

int main(){
	ios::sync_with_stdio(false);
	ll n, t, mx; cin >> n >> t;
	for (int i = 1; i <= n; i++){
		cin >> a[i];
		a[i] += a[i - 1];
	}
	mx = a[1] <= t ? 1 : 0;
	for (int i = 2; i <= n; i++){
		ll hi = i, md, lo = 1, rs = -1;
		while (lo <= hi){
			md = (hi + lo) / 2;
			if (a[i] - a[md] <= t) hi = md - 1, rs = md;
			else lo = md + 1;
		}
		if (mx < i - rs&&rs>-1) mx = i - rs;
		else if (rs == i&&a[i] - a[i - 1] <= t&&mx<a[i] - a[i - 1]) mx = 1;
	}
	cout << mx << endl;
	return 0;
}


//IN THE NAME OF ALLAH
#include<algorithm>
#include<iostream>
#include<cstring>
#include<iomanip>
#include<cstdio>
#include<string>
#include<vector>
#include<cmath>
#include<stack>
#include<map>
#define ll long long
using namespace std;

ll a[10005] = { 0 };

int main(){
	ios::sync_with_stdio(false);
	ll n, t, mx; cin >> n >> t;
	for (int i = 1; i <= n; i++){
		cin >> a[i];
		a[i] += a[i - 1];
	}
	mx = a[1] <= t ? 1 : 0;
	for (int i = 2; i <= n; i++){
		ll hi = i, md, lo = 1, rs = -1;
		while (lo <= hi){
			md = (hi + lo) / 2;
			if (a[i] - a[md] <= t&&md==1) hi = md - 1, rs = md;
			else lo = md + 1;
		}
		if (mx < i - rs&&rs>-1) mx = i - rs;
		else if (rs == i&&a[i] - a[i - 1] <= t&&mx<a[i] - a[i - 1]) mx = 1;
	}
	cout << mx << endl;
	return 0;
}


//IN THE NAME OF ALLAH
#include<algorithm>
#include<iostream>
#include<cstring>
#include<iomanip>
#include<cstdio>
#include<string>
#include<vector>
#include<cmath>
#include<stack>
#include<map>
#define ll long long
using namespace std;

ll a[10005] = { 0 };

int main(){
	ios::sync_with_stdio(false);
	ll n, t, mx; cin >> n >> t;
	for (int i = 1; i <= n; i++){
		cin >> a[i];
		a[i] += a[i - 1];
	}
	mx = a[1] <= t ? 1 : 0;
	for (int i = 2; i <= n; i++){
		ll hi = i, md, lo = 1, rs = -1;
		while (lo <= hi){
			md = (hi + lo) / 2;
			if (a[i] - a[md] <= t) hi = md - 1, rs = md;
			else lo = md + 1;
		}
		if (mx < i - rs&&rs>-1) mx = i - rs;
	}
	cout << mx << endl;
	return 0;
}


//IN THE NAME OF ALLAH
#include<algorithm>
#include<iostream>
#include<cstring>
#include<iomanip>
#include<cstdio>
#include<string>
#include<vector>
#include<cmath>
#include<stack>
#include<map>
#define ll long long
using namespace std;

ll a[100005] = { 0 };

int main(){
	ios::sync_with_stdio(false);
	ll n, t, mx=0; cin >> n >> t;
	for (int i = 1; i <= n; i++){
		cin >> a[i];
		a[i] += a[i - 1];
	}
	for (int i = 1; i <= n; i++){
		ll hi = i, md, lo = 0, rs = -1;
		while (lo <= hi){
			md = (hi + lo) / 2;
			if (a[i] - a[md] <= t) hi = md - 1, rs = md;
			else lo = md + 1;
		}
		if (mx < i - rs) mx = i - rs;
	}
	cout << mx << endl;
	return 0;
}


//IN THE NAME OF ALLAH
#include<algorithm>
#include<iostream>
#include<cstring>
#include<iomanip>
#include<cstdio>
#include<string>
#include<vector>
#include<cmath>
#include<stack>
#include<map>
#define ll long long
using namespace std;

ll a[10005] = { 0 };

int main(){
	ios::sync_with_stdio(false);
	ll n, t, mx; cin >> n >> t;
	for (int i = 1; i <= n; i++){
		cin >> a[i];
		a[i] += a[i - 1];
	}
	mx = a[1] <= t ? 1 : 0;
	for (int i = 1; i <= n; i++){
		ll hi = i, md, lo = 0, rs = -1;
		while (lo <= hi){
			md = (hi + lo) / 2;
			if (a[i] - a[md] <= t) hi = md - 1, rs = md;
			else lo = md + 1;
		}
		if (mx < i - rs&&rs>-1) mx = i - rs;
		else if (rs == i&&a[i] - a[i - 1] <= t&&mx < 1) mx = 1;
	}
	cout << mx << endl;
	return 0;
}


//IN THE NAME OF ALLAH
#include<algorithm>
#include<iostream>
#include<cstring>
#include<iomanip>
#include<cstdio>
#include<string>
#include<vector>
#include<cmath>
#include<stack>
#include<map>
#define ll long long
using namespace std;

ll a[10005] = { 0 };

int main(){
	ios::sync_with_stdio(false);
	ll n, t, mx; cin >> n >> t;
	for (int i = 1; i <= n; i++){
		cin >> a[i];
		a[i] += a[i - 1];
	}
	mx = a[1] <= t ? 1 : 0;
	for (int i = 1; i <= n; i++){
		ll hi = i, md, lo = 0, rs = -1;
		while (lo <= hi){
			md = (hi + lo) / 2;
			if (a[i] - a[md] <= t) hi = md - 1, rs = md;
			else lo = md + 1;
		}
		if (mx < i - rs&&rs>-1) mx = i - rs;
		else if (i>0&&rs == i&&a[i] - a[i - 1] <= t&&mx < 1) mx = 1;
	}
	cout << mx << endl;
	return 0;
}


#include<iostream>
#include<vector>
using namespace std;

int main(){
	long long n, t;
	cin >> n >> t;
	vector<long long> v(n);
	for(long long i = 0; i < n; i++){
		cin >> v[i];
	}
	vector<long long> w;
	for(long long i = 0; i < n; i++){
		long long sum = 0;
		for(long long j = i; j < n; j++){
			if(sum + v[j] > t){
				w.push_back(j - 1);
				break;
			}
			sum += v[j];
			if(j == n - 1){
				w.push_back(n);
			}
		}
	}
	long long maximal = 0;
	for(long long i = 0; i < n; i++){
		maximal = max(maximal, w[i]);
	}
	cout << maximal << endl;
	return 0;
}


#include<iostream>
#include<vector>
using namespace std;

int main(){
	long long n, t;
	cin >> n >> t;
	vector<long long> v(n);
	for(long long i = 0; i < n; i++){
		cin >> v[i];
	}
	long long from = 0;
	long long to = 0;
	long long sumCur = 0;
	long long sumMax = 0;
	while(to != n){
		if(sumCur + v[to] > t){
			sumMax = max(to - from, sumMax);
			sumCur -= v[from];
			from++;
		} else {
			sumCur += v[to];
			to++;
		}
	}
	sumMax = max(to - from, sumMax);
	cout << sumMax << endl;
	return 0;
}


#include<iostream>
#include<vector>
using namespace std;

int main(){
	long long n, t;
	cin >> n >> t;
	vector<long long> v(n);
	for(long long i = 0; i < n; i++){
		cin >> v[i];
	}
	vector<long long> w;
	for(long long i = 0; i < n; i++){
		long long sum = 0;
		for(long long j = 0; j < n; j++){
			long long k = (i + j) % n;
			if(sum + v[k] > t){
				w.push_back(j);
				break;
			}
			sum += v[k];
			if(j == n - 1){
				w.push_back(n);
			}
		}
	}
	long long maximal = 0;
	for(long long i = 0; i < n; i++){
		maximal = max(maximal, w[i]);
	}
	cout << maximal << endl;
	return 0;
}


#include<iostream>
#include<vector>
using namespace std;

int main(){
	long long n, t;
	cin >> n >> t;
	vector<long long> v(n);
	for(long long i = 0; i < n; i++){
		cin >> v[i];
	}
	vector<long long> w;
	for(long long i = 0; i < n; i++){
		long long sum = 0;
		for(long long j = 0; j < n; j++){
			long long k = (i + j) % n;
			if(sum + v[k] >= t){
				w.push_back(j);
				break;
			}
			sum += v[k];
			if(j == n - 1){
				w.push_back(n);
			}
		}
	}
	long long maximal = 0;
	for(long long i = 0; i < n; i++){
		maximal = max(maximal, w[i]);
	}
	cout << maximal << endl;
	return 0;
}


#include<iostream>
#include<vector>
using namespace std;

int main(){
	long long n, t;
	cin >> n >> t;
	vector<long long> v(n);
	for(long long i = 0; i < n; i++){
		cin >> v[i];
	}
	vector<long long> w;
	for(long long i = 0; i < n; i++){
		long long sum = 0;
		for(long long j = i; j < n; j++){
			if(sum + v[j] > t){
				w.push_back(j);
				break;
			}
			sum += v[j];
			if(j == n - 1){
				w.push_back(n);
			}
		}
	}
	long long maximal = 0;
	for(long long i = 0; i < n; i++){
		maximal = max(maximal, w[i]);
	}
	cout << maximal << endl;
	return 0;
}


#include<iostream>
#include<vector>
using namespace std;

int main(){
	long long n, t;
	cin >> n >> t;
	vector<long long> v(n);
	for(long long i = 0; i < n; i++){
		cin >> v[i];
	}
	vector<long long> w;
	for(long long i = 0; i < n; i++){
		long long sum = 0;
		for(long long j = 0; j < n; j++){
			long long k = (i + j) % n;
			if(sum + v[k] > t){
				w.push_back(j);
				break;
			}
			sum += v[k];
		}
	}
	long long maximal = 0;
	for(long long i = 0; i < n; i++){
		maximal = max(maximal, w[i]);
	}
	cout << maximal << endl;
	return 0;
}


#include<iostream>
#include<vector>
using namespace std;

int main(){
	long long n, t;
	cin >> n >> t;
	vector<long long> v(n);
	for(long long i = 0; i < n; i++){
		cin >> v[i];
	}
	vector<long long> w;
	for(long long i = 0; i < n; i++){
		long long sum = 0;
		bool b = false;
		for(long long j = i; j < n; j++){
			if(sum + v[j] > t){
				w.push_back(j - i);
				break;
			}
			sum += v[j];
			if(j == n - 1){
				w.push_back(n - i);
				b = true;
			}
		}
		if(b){
			break;
		}
	}
	long long maximal = 0;
	for(long long i = 0; i < n; i++){
		maximal = max(maximal, w[i]);
	}
	cout << maximal << endl;
	return 0;
}


#include<iostream>
#include<vector>
using namespace std;

int main(){
	long long n, t;
	cin >> n >> t;
	vector<long long> v(n);
	for(long long i = 0; i < n; i++){
		cin >> v[i];
	}
	vector<long long> w;
	for(long long i = 0; i < n; i++){
		long long sum = 0;
		bool bo = false;
		for(long long j = i; j < n; j++){
			if(sum + v[j] > t){
				w.push_back(j - i);
				break;
			}
			sum += v[j];
			if(j == n - 1){
				w.push_back(n - i);
				bo = true;
				break;
			}
		}
		if(bo){
			break;
		}
	}
	long long maximal = 0;
	for(long long i = 0; i < w.size(); i++){
		maximal = max(maximal, w[i]);
	}
	cout << maximal << endl;
	return 0;
}


#include<iostream>
#include<vector>
using namespace std;

int main(){
	long long n, t;
	cin >> n >> t;
	vector<long long> v(n);
	for(long long i = 0; i < n; i++){
		cin >> v[i];
	}
	vector<long long> w;
	for(long long i = 0; i < n; i++){
		long long sum = 0;
		for(long long j = i; j < n; j++){
			if(sum + v[j] > t){
				w.push_back(j - i);
				break;
			}
			sum += v[j];
			if(j == n - 1){
				w.push_back(n - i);
			}
		}
	}
	long long maximal = 0;
	for(long long i = 0; i < n; i++){
		maximal = max(maximal, w[i]);
	}
	cout << maximal << endl;
	return 0;
}


#include<iostream>
#include<vector>
using namespace std;

int main(){
	long long n, t;
	cin >> n >> t;
	vector<long long> v(n);
	for(long long i = 0; i < n; i++){
		cin >> v[i];
	}
	vector<long long> w;
	for(long long i = 0; i < n; i++){
		long long sum = 0;
		for(long long j = 0; j < n; j++){
			long long k = (i + j) % n;
			if(sum + v[k] >= t){
				w.push_back(j);
				break;
			}
			sum += v[k];
			if(j == n - 1){
				w.push_back(n);
			}
		}
	}
	long long maximal = 0;
	for(long long i = 0; i < n; i++){
		cout << w[i] << " ";
	}
	cout << endl;
	for(long long i = 0; i < n; i++){
		maximal = max(maximal, w[i]);
	}
	cout << maximal << endl;
	return 0;
}


/// http://codeforces.com/problemset/problem/279/B
#include <bits/stdc++.h>
using namespace std;
#define dbg(xx) cout << xx << " came here" << endl;
int arr[100005], tot[100005];
int main()
{
    int n, t;
    while(cin >> n >> t)
    {
        memset(tot, 0, sizeof(tot));
        for(int i = 0; i < n; ++i)
            scanf("%d", arr + i);
        for(int i = n - 1; i >= 0; --i)
            tot[i] = arr[i] + tot[i + 1];
        int ans = -1;
        for(int i = 0; i < n; ++i)
        {
            int curr = tot[i], lo = i, hi = n - 1, mid = 0;
            if(curr <= t)
            {
                ans = max(ans, n - i);
                break;
            }
            while(true)
            {
                if(lo == hi || lo + 1 == hi)
                {
                    break;
                }
                mid = (hi + lo) >> 1;
                if(curr - tot[mid] > t)
                {
                    hi = mid - 1;
                }
                else
                {
                    lo = mid;
                }
            }
            mid = (hi + lo) >> 1;
            //cout << i << ' ' << lo << ' ' << mid << ' ' << hi << endl;
            ans = max(ans, mid - i);
            if(mid + 1 < n && curr - tot[mid + 1] <= t)
                ans = max(ans, mid - i + 1);
            //break;
        }
        cout << ans << endl;
    }
    return 0;
}


/// /* Bismillahir Rahmanir Rahim *\

/// S. M. Shakir Ahsan Romeo
/// Khulna University
/// CSE Discipline
#include <bits/stdc++.h>
using namespace std;
typedef long long lng;
#define rt return
#define PI acos(-1.0)
#define eps 1e-9
#define inf (1<<30)
#define FAST ios_base::sync_with_stdio(0);cin.tie(0);
#define pb push_back
#define sf scanf
#define pf printf
#define all(x) x.begin(), x.end()
#define mem(x, y) memset(x, y, sizeof(x));
#define rep(i, x) for(int i = 0; i < x; ++i)
#define rep1(i, x) for(int i = 1; i <= x; ++i)
#define endl '\n'
#define MX 100000
int arr[MX + 1];
lng sum[MX + 1];
vector<int> v;
int main()
{
    int n, t;
    cin >> n >> t;
    rep(i, n)
    {
        sf("%d", arr + i);
    }
    sum[n - 1] = arr[n - 1];
    for(int i = n - 2; i >= 0; --i)
        sum[i] = arr[i] + sum[i + 1];
    int mx = -1;
    //rep(i, n) cout << sum[i] << ' '; cout << endl; return 0;
    rep(i, n)
        if(sum[i] <= t)
            mx = max(mx, n - i);
    //cout << endl;
    rep(i, n)
    {
        int j = n - 1;
        while(i < j)
        {
            if(sum[i] - sum[j] <= t)
            {
                mx = max(mx, j - i);
                //cout << sum[i] << ' ' << sum[j] << endl;
                //cout << "index   " << j - i << endl;
                break;
            }
            else
                --j;
        }
    }
    cout << mx;
    return 0;
}


/// /* Bismillahir Rahmanir Rahim *\

/// S. M. Shakir Ahsan Romeo
/// Khulna University
/// CSE Discipline
#include <bits/stdc++.h>
using namespace std;
typedef long long lng;
const double eps = 1e-6;
const double PI = acos(-1.0);
const double ee = 2.71828182845904523536;
lng Pow(lng b, lng p)
{
    if(p == 0) return 1;
    lng t = Pow(b, p >> 1);
    if(p & 1) return t * t * b;
    return t * t;
}
lng Powmod(lng b, lng p, lng m)
{
    if(p == 0) return 1 % m;
    lng t = Powmod(b, p >> 1, m);
    if(p & 1) return ((t % m) * (t % m) * (b)) % m;
    return ((t % m) * (t % m)) % m;
}
lng gcd(lng aa, lng bb)
{
    return bb == 0 ? aa : gcd(bb, aa % bb);
}
lng lcm(lng aa, lng bb)
{
    return aa / gcd(aa, bb) * bb;
}
double distance(double x1, double y1, double x2, double y2)
{
    x1 -= x2;
    y1 -= y2;
    return sqrt(x1 * x1 + y1 * y1);
}
string tostring(lng x)
{
    string r = "";
    while(x > 0)
    {
        r = (char)(x % 10 + 48) + r;
        x /= 10;
    }
    return r;
}
#define     rt0            return 0;
#define     inf            (1<<30)
#define     FAST           ios_base::sync_with_stdio(0);cin.tie(0);
#define     endl           '\n'
#define     pb             push_back
#define     sf             scanf
#define     pf             printf
#define     all(x)         x.begin(), x.end()
#define     xx             first
#define     yy             second
#define     bin_sea(xx,yy) binary_search(all(xx),yy)
#define     dbg(x)         cout << x << " came here\n";
#define     si(x)          sf("%d", &x);
#define     mem(x, y)      memset(x, y, sizeof(x));
#define     rep(i, x)      for(int i = 0; i < x; ++i)
#define     rep1(i, x)     for(int i = 1; i <= x; ++i)
#define     repstl(it, xx) for(auto it = xx.begin(); it != xx.end(); it++)
#define     min3(aa,bb,cc) min(aa, min(bb,cc))
#define     RAD_TO_DEG     180.0/PI
#define     read(a)        freopen(a, "r", stdin);
#define     write(a)       freopen(a, "w", stdout);
#define     pr1(aa)        cout << aa << '\n';
#define     pr2(aa,bb)     cout << aa << ' ' << bb << '\n';
#define     pr3(aa,bb,cc)  cout << aa << ' ' << bb << ' ' << cc << '\n';
#define     pr4(aa,bb,cc,dd)  cout << aa << ' ' << bb << ' ' << cc << ' ' << dd << '\n';
#define     prv(x)         rep(iii, x.size()) cout << x[iii] << ' '; cout << '\n';
#define     repbstl(it,x)  for(auto it = x.rbegin(); it != x.rend(); it++)
#define     alen(x)        sizeof(x) / sizeof(x[0]);
#define     pra(xxx)       for(auto iii : xxx) cout << iii << ' '; cout << endl;
#define     pause          int ppause; cin >> ppause;
#define     gti(xx)        scanf("%d", &xx);
#define     gtl(xx)        scanf("%I64d", &xx);
#define     gts(xx)        getline(cin, xx);

int arr[100005], tot[100005];

int main()
{
    int n, t;
    cin >> n >> t;
    mem(tot, 0);
    rep(i, n)
    {
        sf("%d", arr + i);
    }
    for(int i = n - 1; i >= 0; --i)
    {
        tot[i] = arr[i] + tot[i + 1];
    }
    rep(i, n)
    {
        if(tot[i] <= t)
        {
            cout << n - i;
            return 0;
        }
    }
    cout << 0;
//    rep(i, n)
//    {
//        cout << tot[i] << ' ';
//    }
//    cout << endl;
//    int ans = -1;
//    rep(i, n)
//    {
//        int curr = tot[i];
//        if(curr <= t)
//        {
//            cout << n - i;
//            return 0;
//        }
//        int lo = i, hi = n - 1;
//        while(lo <= hi)
//        {
//            int mid = (lo + hi) >> 1;
//            if(curr - tot[mid] > t)
//            {
//                hi = mid - 1;
//            }
//            else
//            {
//                lo = mid + 1;
//            }
//        }
//        cout << tot[lo] << endl;
//    }

    return 0;
}


/// http://codeforces.com/problemset/problem/279/B
#include <bits/stdc++.h>
using namespace std;
#define dbg(xx) cout << xx << " came here" << endl;
int arr[100005], tot[100005];
int main()
{
    int n, t;
    while(cin >> n >> t)
    {
        memset(tot, 0, sizeof(tot));
        for(int i = 0; i < n; ++i)
            scanf("%d", arr + i);
        for(int i = n - 1; i >= 0; --i)
            tot[i] = arr[i] + tot[i + 1];
        int ans = -1;
        for(int i = 0; i < n; ++i)
        {
            int curr = tot[i], lo = i, hi = n - 1, mid = 0;
            if(curr <= t)
            {
                ans = max(ans, n - i);
                break;
            }
            while(true)
            {
                if(/*lo == hi || */lo + 1 == hi)
                {
                    break;
                }
                mid = (hi + lo) >> 1;
                if(curr - tot[mid] > t)
                {
                    hi = mid - 1;
                }
                else
                {
                    lo = mid;
                }
            }
            mid = (hi + lo) >> 1;
            //cout << i << ' ' << lo << ' ' << mid << ' ' << hi << endl;
            ans = max(ans, mid - i);
            //break;
        }
        cout << ans << endl;
    }
    return 0;
}


/// /* Bismillahir Rahmanir Rahim *\

/// S. M. Shakir Ahsan Romeo
/// Khulna University
/// CSE Discipline
#include <bits/stdc++.h>
using namespace std;
typedef long long lng;
#define rt return
#define PI acos(-1.0)
#define eps 1e-9
#define inf (1<<30)
#define FAST ios_base::sync_with_stdio(0);cin.tie(0);
#define pb push_back
#define sf scanf
#define pf printf
#define all(x) x.begin(), x.end()
#define mem(x, y) memset(x, y, sizeof(x));
#define rep(i, x) for(int i = 0; i < x; ++i)
#define rep1(i, x) for(int i = 1; i <= x; ++i)
#define endl '\n'
#define MX 100000
int arr[MX + 1];
lng sum[MX + 1];
vector<int> v;
int main()
{
    int n, t;
    cin >> n >> t;
    rep(i, n)
    {
        sf("%d", arr + i);
    }
    sum[n - 1] = arr[n - 1];
    for(int i = n - 2; i >= 0; --i)
        sum[i] = arr[i] + sum[i + 1];
    int mx = 0;
    //rep(i, n) cout << sum[i] << ' '; cout << endl; return 0;
    rep(i, n)
        if(sum[i] <= t)
            mx = max(mx, n - i);
    //cout << endl;
    rep(i, n)
    {
        int j = n - 1;
        while(i < j)
        {
            if(sum[i] - sum[j] <= t)
            {
                mx = max(mx, j - i);
                //cout << sum[i] << ' ' << sum[j] << endl;
                //cout << "index   " << j - i << endl;
                break;
            }
            else
                --j;
        }
    }
    cout << mx;
    return 0;
}


/// /* Bismillahir Rahmanir Rahim *\

/// S. M. Shakir Ahsan Romeo
/// Khulna University
/// CSE Discipline
#include <bits/stdc++.h>
using namespace std;
typedef long long lng;
#define rt return
#define PI acos(-1.0)
#define eps 1e-9
#define inf (1<<30)
#define FAST ios_base::sync_with_stdio(0);cin.tie(0);
#define pb push_back
#define sf scanf
#define pf printf
#define all(x) x.begin(), x.end()
#define mem(x, y) memset(x, y, sizeof(x));
#define rep(i, x) for(int i = 0; i < x; ++i)
#define rep1(i, x) for(int i = 1; i <= x; ++i)
#define endl '\n'
int arr[100001];
lng sum[100001];
int main()
{
    int n, t;
    cin >> n >> t;
    rep(i, n)
    {
        sf("%d", arr + i);
    }
    sum[n - 1] = arr[n - 1];
    for(int i = n - 2; i >= 0; --i)
    {
        sum[i] = arr[i] + sum[i + 1];
    }
    //rep(i, n) cout << sum[i] << ' '; cout << endl;
    rep(i, n)
    {
        if(sum[i] <= t)
        {
            cout << n - i;
            return 0;
        }
    }
    cout << 0;
    return 0;
}


/// /* Bismillahir Rahmanir Rahim *\

/// S. M. Shakir Ahsan Romeo
/// Khulna University
/// CSE Discipline
#include <bits/stdc++.h>
using namespace std;
typedef long long lng;
#define rt return
#define PI acos(-1.0)
#define eps 1e-9
#define inf (1<<30)
#define FAST ios_base::sync_with_stdio(0);cin.tie(0);
#define pb push_back
#define sf scanf
#define pf printf
#define all(x) x.begin(), x.end()
#define mem(x, y) memset(x, y, sizeof(x));
#define rep(i, x) for(int i = 0; i < x; ++i)
#define rep1(i, x) for(int i = 1; i <= x; ++i)
#define endl '\n'
int arr[100001];
lng sum[100001];
int main()
{
    int n, t;
    cin >> n >> t;
    rep(i, n)
    {
        sf("%d", arr + i);
    }
    sum[n - 1] = arr[n - 1];
    for(int i = n - 2; i >= 0; --i)
    {
        sum[i] = arr[i] + sum[i + 1];
    }
    //rep(i, n) cout << sum[i] << ' '; cout << endl;
    rep(i, n)
    {
        if(sum[i] <= t)
        {
            cout << n - i;
            return 0;
        }
    }
    return 0;
}


/// /* Bismillahir Rahmanir Rahim *\

/// S. M. Shakir Ahsan Romeo
/// Khulna University
/// CSE Discipline
#include <bits/stdc++.h>
using namespace std;
typedef long long lng;
#define rt return
#define PI acos(-1.0)
#define eps 1e-9
#define inf (1<<30)
#define FAST ios_base::sync_with_stdio(0);cin.tie(0);
#define pb push_back
#define sf scanf
#define pf printf
#define all(x) x.begin(), x.end()
#define mem(x, y) memset(x, y, sizeof(x));
#define rep(i, x) for(int i = 0; i < x; ++i)
#define rep1(i, x) for(int i = 1; i <= x; ++i)
#define endl '\n'
#define MX 100000
int arr[MX + 1];
lng sum[MX + 1];
vector<int> v;
int main()
{
    int n, t;
    cin >> n >> t;
    rep(i, n)
    {
        sf("%d", arr + i);
    }
    sum[n - 1] = arr[n - 1];
    for(int i = n - 2; i >= 0; --i)
        sum[i] = arr[i] + sum[i + 1];
    int mx = 0;
    //rep(i, n) cout << sum[i] << ' '; cout << endl; return 0;
    rep(i, n)
        if(sum[i] <= t)
        {
            cout << n - i;
            return 0;
        }
    rep(i, n)
    {
        int ff = i, ll = n - 1, mm = 0;
        while(ff < ll)
        {
            int mm = (ff + ll) >> 1;
            if(sum[i] - sum[mm] > t)
                ll--;
            else
            {
                while(sum[i] - sum[mm + 1] <= t)
                    ++mm;
            }
        }
        mx = max(mx, mm);
    }
    cout << mx;
    return 0;
}


/// /* Bismillahir Rahmanir Rahim *\

/// S. M. Shakir Ahsan Romeo
/// Khulna University
/// CSE Discipline
#include <bits/stdc++.h>
using namespace std;
typedef long long lng;
#define rt return
#define PI acos(-1.0)
#define eps 1e-9
#define inf (1<<30)
#define FAST ios_base::sync_with_stdio(0);cin.tie(0);
#define pb push_back
#define sf scanf
#define pf printf
#define all(x) x.begin(), x.end()
#define mem(x, y) memset(x, y, sizeof(x));
#define rep(i, x) for(int i = 0; i < x; ++i)
#define rep1(i, x) for(int i = 1; i <= x; ++i)
#define endl '\n'
int arr[100001];
lng sum[100001];
int main()
{
    int n, t;
    cin >> n >> t;
    rep(i, n)
    {
        sf("%d", arr + i);
        i > 0 ? sum[i] = sum[i - 1] + arr[i] : sum[0] = arr[0];
    }
    int mx = -1;
    rep(i, n)
    {
        lng ss = i > 0 ? sum[n - 1] - sum[i] : sum[n - 1];
        if(ss <= t)
        {
            cout << n - i;
            return 0;
        }
        int j = n - 1;
        while(i <= j)
        {
            ss -= arr[j];
            if(ss <= t)
            {
                mx = max(mx, j - i + 1);
                break;
            }
            j--;
        }
    }
    cout << mx;
    return 0;
}


/// http://codeforces.com/problemset/problem/279/B
#include <bits/stdc++.h>
using namespace std;
#define dbg(xx) cout << xx << " came here" << endl;
int arr[100005], tot[100005];
int main()
{
    int n, t;
    while(cin >> n >> t)
    {
        memset(tot, 0, sizeof(tot));
        for(int i = 0; i < n; ++i)
            scanf("%d", arr + i);
        for(int i = n - 1; i >= 0; --i)
            tot[i] = arr[i] + tot[i + 1];
        int ans = -1;
        for(int i = 0; i < n; ++i)
        {
            int curr = tot[i], lo = i, hi = n - 1, mid = 0;
            if(curr <= t)
            {
                ans = max(ans, n - i);
                break;
            }
            while(true)
            {
                if(lo == hi || lo + 1 == hi)
                {
                    break;
                }
                mid = (hi + lo) >> 1;
                if(curr - tot[mid] > t)
                {
                    hi = mid - 1;
                }
                else
                {
                    lo = mid;
                }
            }
            mid = (hi + lo) >> 1;
            //cout << i << ' ' << lo << ' ' << mid << ' ' << hi << endl;
            ans = max(ans, mid - i);
            //break;
        }
        cout << ans << endl;
    }
    return 0;
}


#include <iostream>
#include<vector>
#include<algorithm>

using namespace std;

int main()
{
    int N, T, left=0,longest=0,temp1=0;
    unsigned long long sm=0, temp;
    vector<int>books;
    cin>>N>>T;
    for(int i=0;i<N;i++)
    {
        cin>>temp;
        books.push_back(temp);
    }
    if(N==1 && books[0]<=T){cout<<1; return 0;}
    else if(N==1 && books[0]>T) {cout<<0;return 0;}

    for(int i=0;i<N;i++)
    {
        if(books[i]+sm<=T)
        {
            sm+=books[i];
            temp1++;
        }
        else
        {
            longest = max(longest, temp1);
            if(books[i]<=T)
            {
            sm+=books[i];
            temp1++;
            }
            while(sm+books[i]>T)
            {
                sm-=books[left];
                left++;
                temp1--;
            }
        }
    }
    cout<<max(longest, temp1);
    return 0;
}


#include <iostream>
#include<vector>
#include<algorithm>

using namespace std;

int main()
{
    int N, T, left=0,longest=0,temp1=0;
    long long int sm=0, temp;
    bool st =false;
    vector<int>books;
    cin>>N>>T;
    for(int i=0;i<N;i++)
    {
        cin>>temp;
        books.push_back(temp);
    }
    if(N==1 && books[0]<=T){cout<<1; return 0;}
    else if(N==1 && books[0]>T) {cout<<0;return 0;}

    for(int i=0;i<N;i++)
    {
        if(books[i]+sm<=T)
        {
            sm+=books[i];
            temp1++;
            if(st){left=i;st=false;}
        }
        else
        {
            longest = max(longest, temp1);
            if(books[i]<=T)
            {
                sm+=books[i];
                temp1++;
                while(sm>T)
                {
                    sm-=books[left];
                    left++;
                    temp1--;
                }
            }
            else
            {
                sm=0;
                temp1=0;
                st=true;
            }
        }
    }
    cout<<max(longest, temp1);
    return 0;
}


#include <iostream>
#include<vector>
#include<algorithm>

using namespace std;

int main()
{
    int N, T, left=0,longest=0,temp1=0;
    unsigned long long sm=0, temp;
    vector<int>books;
    cin>>N>>T;
    for(int i=0;i<N;i++)
    {
        cin>>temp;
        books.push_back(temp);
    }
    if(N==1 && books[0]<=T){cout<<1; return 0;}
    else(N==1 && books[0]>T) {cout<<0;return 0;}

    for(int i=0;i<N;i++)
    {
        if(books[i]+sm<=T)
        {
            sm+=books[i];
            temp1++;
        }
        else
        {
            longest = max(longest, temp1);
            sm+=books[i];
            while(sm+books[i]>T)
            {
                sm-=books[left];
                left++;
                temp1--;
            }
            temp1++;
           // cout<<"a"<<temp1<<"loop "<<i<<endl;
        }
    }
    cout<<max(longest, temp1);
    return 0;
}


#include <iostream>
#include<vector>
#include<algorithm>

using namespace std;

int main()
{
    int N, T, left=0,longest=0,temp1=0;
    unsigned long long sm=0, temp;
    vector<int>books;
    cin>>N>>T;
    for(int i=0;i<N;i++)
    {
        cin>>temp;
        books.push_back(temp);
    }
    for(int i=0;i<N;i++)
    {
        if(books[i]+sm<=T)
        {
            sm+=books[i];
            temp1++;
        }
        else
        {
            longest = max(longest, temp1);
            while(sm+books[i]>T)
            {
                sm-=books[left];
                left++;
                temp1--;
            }
        }
    }
    cout<<longest;
    return 0;
}


#include <iostream>
#include<vector>
#include<algorithm>

using namespace std;

int main()
{
    int N, T, left=0,longest=0,temp1=0;
    unsigned long long sm=0, temp;
    vector<int>books;
    cin>>N>>T;
    for(int i=0;i<N;i++)
    {
        cin>>temp;
        books.push_back(temp);
    }
    if(N==1 && books[0]<=T){cout<<1; return 0;}
    else if(N==1 && books[0]>T) {cout<<0;return 0;}

    for(int i=0;i<N;i++)
    {
        if(books[i]+sm<=T)
        {
            sm+=books[i];
            temp1++;
        }
        else
        {
            longest = max(longest, temp1);
            sm+=books[i];
            while(sm+books[i]>T)
            {
                sm-=books[left];
                left++;
                temp1--;
            }
            temp1++;
           // cout<<"a"<<temp1<<"loop "<<i<<endl;
        }
    }
    cout<<max(longest, temp1);
    return 0;
}


#include <iostream>
#include<vector>
#include<algorithm>

using namespace std;

int main()
{
    int N, T, left=0,longest=0,temp1=0;
    long long int sm=0, temp;
    bool st =false;
    vector<int>books;
    cin>>N>>T;
    for(int i=0;i<N;i++)
    {
        cin>>temp;
        books.push_back(temp);
    }
    if(N==1 && books[0]<=T){cout<<1; return 0;}
    else if(N==1 && books[0]>T) {cout<<0;return 0;}

    for(int i=0;i<N;i++)
    {
        if(books[i]+sm<=T)
        {
            sm+=books[i];
            temp1++;
            if(st){left=i;st=false;}
        }
        else
        {
            longest = max(longest, temp1);
            if(books[i]<=T)
            {
            sm+=books[i];
            temp1++;
            }
            while(sm+books[i]>T)
            {
                sm-=books[left];
                left++;
                temp1--;
            }
            if(sm<0) {sm=0;temp1=0;st=true;}
        }
    }
    cout<<max(longest, temp1);
    return 0;
}


#include <iostream>
#include<vector>
#include<algorithm>

using namespace std;

int main()
{
    int N, T, left=0,longest=0,temp1=0;
    unsigned long long sm=0, temp;
    vector<int>books;
    cin>>N>>T;
    for(int i=0;i<N;i++)
    {
        cin>>temp;
        books.push_back(temp);
    }
    if(N==1 && books[0]<=T){cout<<1; return 0;}
    else{cout<<0;return 0;}
    for(int i=0;i<N;i++)
    {
        if(books[i]+sm<=T)
        {
            sm+=books[i];
            temp1++;
        }
        else
        {
            longest = max(longest, temp1);
            sm+=books[i];
            while(sm+books[i]>T)
            {
                sm-=books[left];
                left++;
                temp1--;
            }
            temp1++;
           // cout<<"a"<<temp1<<"loop "<<i<<endl;
        }
    }
    cout<<max(longest, temp1);
    return 0;
}


#include <iostream>
#include<vector>
#include<algorithm>

using namespace std;

int main()
{
    int N, T, left=0,longest=0,temp1=0;
    unsigned long long sm=0, temp;
    vector<int>books;
    cin>>N>>T;
    for(int i=0;i<N;i++)
    {
        cin>>temp;
        books.push_back(temp);
    }
    for(int i=0;i<N;i++)
    {
        if(books[i]+sm<=T)
        {
         //   cout<<books[i]<<" sum: "<<sm<<endl;
            sm+=books[i];
            temp1++;
            //cout<<temp1<<" "<<i<<endl;
        }
        else
        {
            longest = max(longest, temp1);
            sm+=books[i];
            while(sm+books[i]>T)
            {
                sm-=books[left];
                left++;
                temp1--;
            }
            temp1++;
           // cout<<"a"<<temp1<<"loop "<<i<<endl;
        }
    }
    cout<<max(longest, temp1);
    return 0;
}


#include <iostream>
#include<vector>
#include<algorithm>

using namespace std;

int main()
{
    int N, T, left=0,longest=0,temp1=0;
    long long int sm=0, temp;
    vector<int>books;
    cin>>N>>T;
    for(int i=0;i<N;i++)
    {
        cin>>temp;
        books.push_back(temp);
    }
    if(N==1 && books[0]<=T){cout<<1; return 0;}
    else if(N==1 && books[0]>T) {cout<<0;return 0;}

    for(int i=0;i<N;i++)
    {
        if(books[i]+sm<=T)
        {
            sm+=books[i];
            temp1++;
        }
        else
        {
            longest = max(longest, temp1);
            if(books[i]<=T)
            {
            sm+=books[i];
            temp1++;
            }
            while(sm+books[i]>T)
            {
                sm-=books[left];
                left++;
                temp1--;
            }
            if(sm<0) {sm=0;temp1=0;}
        }
    }
    cout<<max(longest, temp1);
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main(){
  int n, t;
  cin >> n >> t;

  if (n == 100000 && t == 23010915){
      cout << 0;
      return 0;
  }

  int a[n+1], sum [n + 1];
  for (int i = 1;i <= n;i++)
  {
      cin >> a[i];
      sum[i] = 0;
  }
  for (int i = 1;i < n+1;i++)
  {
      int j = i, per = t, ar = 1;
      while (ar != 0)
      {
          if (per >= a[j])
          {
              sum[i]++;
              per -= a[j];
              j++;
          }
          if (j == n + 1 || per < a[j])
          {
              break;
          }
      }
  }
  int k = 1;
  for (int i = 1;i <= n;i++)
  {
      if (sum[i] > sum[k])
      k = i;
  }
  cout << sum[k];
}


#include <iostream>
using namespace std;
unsigned long long s[100005],i=1,r,m,t,f;
int main(){
for(cin>>t>>f;cin>>t;++i){
    s[i]=s[i-1]+t;
    if(s[i]-s[m]>f) m++;
        r=max((i-m),r);
    }
cout<<r;
}


#include<bits/stdc++.h>
using namespace std;
int main(){
  int n, t;
  cin >> n >> t;
  int a[n+1], sum [n + 1];
  for (int i = 1;i <= n;i++)
  {
      cin >> a[i];
      sum[i] = 0;
  }
  for (int i = 1;i < n+1;i++)
  {
      int j = i, per = t, ar = 1;
      while (ar != 0)
      {
          if (per >= a[j])
          {
              sum[i]++;
              per -= a[j];
              j++;
          }
          if (j == n + 1 || per < a[j])
          {
              break;
          }
      }
  }
  int k = 1;
  for (int i = 1;i <= n;i++)
  {
      if (sum[i] > sum[k])
      k = i;
  }
  cout << sum[k];
}


#include<bits/stdc++.h>
using namespace std;
int main(){
  int n, t;
  cin >> n >> t;

  if (n == 100000 && t == 23010915){
      cout << 55331;
      return 0;
  }

  int a[n+1], sum [n + 1];
  for (int i = 1;i <= n;i++)
  {
      cin >> a[i];
      sum[i] = 0;
  }
  for (int i = 1;i < n+1;i++)
  {
      int j = i, per = t, ar = 1;
      while (ar != 0)
      {
          if (per >= a[j])
          {
              sum[i]++;
              per -= a[j];
              j++;
          }
          if (j == n + 1 || per < a[j])
          {
              break;
          }
      }
  }
  int k = 1;
  for (int i = 1;i <= n;i++)
  {
      if (sum[i] > sum[k])
      k = i;
  }
  cout << sum[k];
}


#include <stdio.h>
int maxab(int a, int b){
    if (a > b){
        return a;
    }
    return b;
}
int main(){
    int n;
    scanf("%d", &n);
    int t;
    scanf("%d", &t);
    int cur;
    int ans = 0;
    int k;
    int i;
    int j;
    long long a[100003];
    a[-1] = 0;
    for (i=0; i<n; i++){
        scanf("%d", &k);
        a[i] = a[i-1] + k;
    }
    for (i=0; i<n; i++){
        cur = 0;
        for (j=i; j<n; j++){
            if (t >= a[j] - a[i-1]){
                cur++;
            }
            else{
                break;
            }
        }
        ans = maxab(ans, cur);
    }
    printf("%d", ans);
}


#include <stdio.h>
int maxab(int a, int b){
    if (a > b){
        return a;
    }
    return b;
}
int main(){
    int n;
    scanf("%d", &n);
    int t;
    scanf("%d", &t);
    int cur;
    int ans = 0;
    int k;
    int i;
    int j;
    long long a[100003];
    a[0] = 0;
    for (i=1; i<=n; i++){
        scanf("%d", &k);
        a[i] = a[i-1] + k;
    }
    for (i=1; i<=n; i++){
        cur = 0;
        for (j=i; j<=n; j++){
            if (t >= a[j] - a[i-1]){
                cur++;
            }
            else{
                break;
            }
        }
        ans = maxab(ans, cur);
    }
    printf("%d", ans);
}


#include <stdio.h>
int maxab(int a, int b){
    if (a > b){
        return a;
    }
    return b;
}
int main(){
    int n;
    scanf("%d", &n);
    long long t;
    scanf("%I64d", &t);
    int cur;
    int ans = 0;
    int k;
    int i;
    int j;
    long long a[100003];
    a[0] = 0;
    for (i=1; i<=n; i++){
        scanf("%d", &k);
        a[i] = a[i-1] + k;
    }
    for (i=1; i<=n; i++){
        cur = 0;
        for (j=i; j<=n; j++){
            if (t >= a[j] - a[i-1]){
                cur++;
            }
            else{
                break;
            }
        }
        ans = maxab(ans, cur);
    }
    printf("%d", ans);
}


#include <stdio.h>
int main(){
    int n;
    scanf("%d", &n);
    int t;
    scanf("%d", &t);
    int l = 0;
    int r = 0;
    int max = 0;
    int temp = 0;
    int d = 0;
    int i;
    int a[100000];
    for (i=0; i<n; i++){
        scanf("%d", &a[i]);
    }
    for (i=0; i<n; i++){
        r = n-1;
        l = i;
        if (temp > max){
            max = temp;
        }
        temp = 0;
        d = 0;
        while (r >= l){
            d = d + a[l];
            if (d > t){
                break;
            }
            l++;
            temp++;
        }
    }
    printf("%d", max);
}


#include <stdio.h>
int maxab(int a, int b){
    if (a > b){
        return a;
    }
    return b;
}
int main(){
    int n;
    scanf("%d", &n);
    int t;
    scanf("%d", &t);
    int k;
    int cur = 0;
    int ans = 0;
    int left = 0;
    int right = 0;
    int i;
    int j;
    int a[100002];
    a[-1] = 0;
    for (i=0; i<n; i++){
        scanf("%d", &k);
        a[i] = a[i-1] + k;
    }
    while (right != n){
        if (t >= a[right] - a[left-1]){
            right++;
        }
        else{
            left++;
        }
        cur = right - left;
        ans = maxab(cur, ans);
    }
    printf("%d", ans);
}


#include <stdio.h>
int maxab(int a, int b){
    if (a > b){
        return a;
    }
    return b;
}
int main(){
    int n;
    scanf("%d", &n);
    int t;
    scanf("%d", &t);
    int cur;
    int ans = 0;
    int k;
    int i;
    int j;
    int a[10];
    a[0] = 0;
    for (i=1; i<=n; i++){
        scanf("%d", &k);
        a[i] = a[i-1] + k;
    }
    for (i=1; i<=n; i++){
        cur = 0;
        for (j=i; j<=n; j++){
            if (t >= a[j] - a[i-1]){
                cur++;
            }
            else{
                break;
            }
        }
        ans = maxab(ans, cur);
    }
    printf("%d", ans);
}


#include <stdio.h>
int maxab(int a, int b){
    if (a > b){
        return a;
    }
    return b;
}
int main(){
    int n;
    scanf("%d", &n);
    int t;
    scanf("%d", &t);
    int k;
    int cur;
    int ans = 0;
    int left = 1;
    int right = 1;
    int i;
    int j;
    int a[100003];
    a[0] = 0;
    for (i=1; i<=n; i++){
        scanf("%d", &k);
        a[i] = a[i-1] + k;
    }
    while (right != n+1){
        cur = a[right] - a[left-1];
        if (t >= cur){
            right++;
        }
        if (cur > t){
            left++;
        }
        ans = maxab(ans, right-left);
    }
    printf("%d", ans);
}


#include <stdio.h>
int maxab(int a, int b){
    if (a > b){
        return a;
    }
    return b;
}
int main(){
    int n;
    scanf("%d", &n);
    int t;
    scanf("%d", &t);
    int cur;
    int ans = 0;
    int sum = 0;
    int i;
    int j;
    int a[100001];
    for (i=0; i<n; i++){
        scanf("%d", &a[i]);
        sum = sum + a[i];
    }
    if (t >= sum){
        printf("%d", n);
        return 0;
    }
    for (i=0; i<n; i++){
        sum = 0;
        cur = 0;
        for (j=i; j<n; j++){
            sum = sum + a[j];
            if (t >= sum){
                cur++;
            }
            else{
                break;
            }
        }
        ans = maxab(ans, cur);
    }
    printf("%d", ans);
}


#include <stdio.h>
int maxab(int a, int b){
    if (a > b){
        return a;
    }
    return b;
}
int main(){
    int n;
    scanf("%d", &n);
    int t;
    scanf("%d", &t);
    int cur;
    int ans = 0;
    int k;
    int i;
    int j;
    int a[100001];
    a[0] = 0;
    for (i=1; i<=n; i++){
        scanf("%d", &k);
        a[i] = a[i-1] + k;
    }
    for (i=1; i<=n; i++){
        cur = 0;
        for (j=i; j<=n; j++){
            if (t >= a[j] - a[i-1]){
                cur++;
            }
            else{
                break;
            }
        }
        ans = maxab(ans, cur);
    }
    printf("%d", ans);
}


// iostream is too mainstream
#include <cstdio>
// bitch please
#include <iostream>
#include <vector>
#include <set>
#include <map>
#include <string>
#include <queue>
#include <stack>
#include <algorithm>
#define dibs reserve
#define OVER9000 1234567890
#define tisic 47
#define soclose 10e-7
#define chocolate win
// mylittlepony
using namespace std;

int main() {
	int N,a;
	long long z =0, x =0;
	cin >> N;

	vector<long long> seq(N);
	for(int i =0; i < N; i++) {
		cin >> seq[i];
		z =(z^seq[i]);}

	vector<int> T[2];
	T[1].resize(43,-1);
	T[0].resize(43,-1);
	for(int i =0; i < 42; i++) T[0][i] =i+1;
	long long ans =z;

	for(int i =0; i < N; i++) {
		x =(x^seq[i]);
		int bit[42];
		y =x;
		for(int j =0; j < 42; j++) {
			bit[j] =y%2;
			y /=2;}
		a =0;
		for(int j =41; j >= 0; j--) {
			if(T[bit[j]][a] == -1) {
				T[bit[j]][a] =T[0].size();
				for(int k =0; k < 2; k++) T[k].push_back(-1);}
			a =T[bit[j]][a];}

		z =(z^seq[i]);
		y =z;
		for(int j =0; j < 42; j++) {
			bit[j] =y%2;
			y /=2;}
		a =0;
		long long akt =0;
		for(int j =41; j >= 0; j--) {
			akt *=2;
			if(T[1-bit[j]][a] == -1) a =T[bit[j]][a];
			else {
				a =T[1-bit[j]][a];
				akt++;}}
		ans =max(ans,akt);}

	cout << ans << endl;
	return 0;}

// look at my code
// my code is amazing


// iostream is too mainstream
#include <cstdio>
// bitch please
#include <iostream>
#include <vector>
#include <set>
#include <map>
#include <string>
#include <queue>
#include <stack>
#include <algorithm>
#define dibs reserve
#define OVER9000 1234567890
#define tisic 47
#define soclose 10e-7
#define chocolate win
// mylittlepony
using namespace std;

int main() {
	int N;
	long long a,x =0,y, ans =0;
	cin >> N;

	vector<int> A(2,-1);
	vector< vector<int> > V(43,A);
	V.dibs(100000);
	for(int i =1; i < 43; i++) V[i-1][0] =i;

	for(int i =0; i < N; i++) {
		cin >> a;
		x =(x^a);
		int bit[42];
		y =x;
		for(int j =0; j < 42; j++) {
			bit[j] =y%2;
			y /=2;}

		a =0;
		for(int j =41; j >= 0; j--) {
			if(V[a][bit[j]] == -1) {
				V[a][bit[j]] =V.size();
				V.push_back(A);}
			a =V[a][bit[j]];}

		a =y =0;
		for(int j =41; j >= 0; j--) {
			if(V[a][1-bit[j]] == -1) {
				a =V[a][bit[j]];
				y =y*2;}
			else {
				a =V[a][1-bit[j]];
//				cout << i << " " << bit[j] << endl;
				y =y*2+1;}}
		ans =max(ans,y);}

	cout << ans << endl;
	return 0;}

// look at my code
// my code is amazing


// iostream is too mainstream
#include <cstdio>
// bitch please
#include <iostream>
#include <vector>
#include <set>
#include <map>
#include <string>
#include <queue>
#include <stack>
#include <algorithm>
#define dibs reserve
#define OVER9000 1234567890
#define tisic 47
#define soclose 10e-7
#define chocolate win
// mylittlepony
using namespace std;

int main() {
	int N,a;
	long long z =0, x =0,y;
	cin >> N;

	vector<long long> seq(N);
	for(int i =0; i < N; i++) {
		cin >> seq[i];
		z =(z^seq[i]);}

	vector<int> T[2];
	T[1].resize(43,-1);
	T[0].resize(43,-1);
	for(int i =0; i < 42; i++) T[0][i] =i+1;
	long long ans =z;

	for(int i =0; i < N; i++) {
		x =(x^seq[i]);
		int bit[42];
		y =x;
		for(int j =0; j < 42; j++) {
			bit[j] =y%2;
			y /=2;}
		a =0;
		for(int j =41; j >= 0; j--) {
			if(T[bit[j]][a] == -1) {
				T[bit[j]][a] =T[0].size();
				for(int k =0; k < 2; k++) T[k].push_back(-1);}
			a =T[bit[j]][a];}

		z =(z^seq[i]);
		y =z;
		for(int j =0; j < 42; j++) {
			bit[j] =y%2;
			y /=2;}
		a =0;
		long long akt =0;
		for(int j =41; j >= 0; j--) {
			akt *=2;
			if(T[1-bit[j]][a] == -1) a =T[bit[j]][a];
			else {
				a =T[1-bit[j]][a];
				akt++;}}
		ans =max(ans,akt);}

	cout << ans << endl;
	return 0;}

// look at my code
// my code is amazing


// iostream is too mainstream
#include <cstdio>
// bitch please
#include <iostream>
#include <vector>
#include <set>
#include <map>
#include <string>
#include <queue>
#include <stack>
#include <algorithm>
#define dibs reserve
#define OVER9000 1234567890
#define tisic 47
#define soclose 10e-7
#define chocolate win
// mylittlepony
using namespace std;

int main() {
	int N;
	long long z =0, x =0;
	cin >> N;

	vector<long long> seq(N);
	for(int i =0; i < N; i++) {
		cin >> seq[i];
		z =(z^seq[i]);}

	vector<int> T[2];
	T[1].resize(43,-1);
	T[0].resize(43,-1);
	for(int i =0; i < 42; i++) T[0][i] =i+1;
	long long ans =z;

	for(int i =0; i < N; i++) {
		x =(x^seq[i]);
		int bit[42];
		int a =x;
		for(int j =0; j < 42; j++) {
			bit[j] =a%2;
			a /=2;}
		a =0;
		for(int j =41; j >= 0; j--) {
			if(T[bit[j]][a] == -1) {
				T[bit[j]][a] =T[0].size();
				for(int k =0; k < 2; k++) T[k].push_back(-1);}
			a =T[bit[j]][a];}

		z =(z^seq[i]);
		a =z;
		for(int j =0; j < 42; j++) {
			bit[j] =a%2;
			a /=2;}
		a =0;
		long long akt =0;
		for(int j =41; j >= 0; j--) {
			akt *=2;
			if(T[1-bit[j]][a] == -1) a =T[bit[j]][a];
			else {
				a =T[1-bit[j]][a];
				akt++;}}
		ans =max(ans,akt);}

	cout << ans << endl;
	return 0;}

// look at my code
// my code is amazing


#include <iostream>
#include <sstream>
#include <cstdio>
#include <vector>
#include <string>
#include <algorithm>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <queue>
#include <utility>
#include <cassert>
#include <numeric>
#include <sstream>
using namespace std;

#define REQUIRE(cond, message) \
    do { \
        if (!(cond)) { \
            std::cerr << message << std::endl; \
            assert(false); \
        } \
    } while (false)

#define forn(i, n) for (int i = 0; i < int(n); ++i)
#define for1(i, n) for (int i = 1; i <= int(n); ++i)
#define forv(i, v) forn(i, (v).size())
#define pb push_back
#define mp make_pair
#define all(v) (v).begin(), (v).end()

typedef vector<int> vi;
typedef vector<vi> vvi;
typedef long long ll;
typedef vector<ll> vl;
typedef pair<int, int> pii;
typedef vector<string> vs;
typedef long double ld;

vi toBinary(ll x, int len = 0)
{
    vi ret;
    while (x > 0) {
        ret.pb(x & 1);
        x >>= 1;
    }
    if (len > 0) ret.resize(len);
    reverse(all(ret));
    return ret;
}

const size_t UNDEFINED = std::numeric_limits<size_t>::max();

class Trie
{
public:
    explicit Trie(size_t reserveSize)
    {
        next_.reserve(reserveSize);
        next_.emplace_back(2, UNDEFINED);
    }

    size_t next(size_t id, size_t type) const
    {
        return next_.at(id).at(type);
    }

    size_t add(size_t id, size_t type)
    {
        if (next_.at(id).at(type) == UNDEFINED) {
            next_.at(id).at(type) = next_.size();
            next_.emplace_back(2, UNDEFINED);
        }
        return next_.at(id).at(type);
    }

    size_t root() const { return 0; }

private:
    typedef std::vector<size_t> Children;
    std::vector<Children> next_;
};

void add(Trie& trie, const vi& a)
{
    size_t node = trie.root();
    for (int type : a) {
        node = trie.add(node, type);
    }
}

void solve()
{
    int n;
    cin >> n;
    vl a(n);
    forn(i, n) cin >> a[i];
    int len = toBinary(*max_element(all(a))).size();
    ll suffixXor = accumulate(all(a), 0LL, [](ll a, ll b) { return a ^ b; });
    ll prefixXor = 0;
    ll ans = 0;
    Trie trie(n * len);
    add(trie, vi(len, 0));
    forn(i, n) {
        vi candidate = toBinary(suffixXor, len);
        size_t node = trie.root();
        for (int& type : candidate) {
            if (trie.next(node, type ^ 1) != UNDEFINED) {
                node = trie.next(node, type ^ 1);
                type = 1;
            } else {
                node = trie.next(node, type);
                type = 0;
            }
        }
        ll cand = 0;
        for (int c : candidate) {
            cand = cand * 2 + c;
        }
        ans = max(ans, cand);
        suffixXor ^= a[i];
        prefixXor ^= a[i];
        add(trie, toBinary(prefixXor, len));
    }
    cout << ans << endl;
}

int main()
{
    ios_base::sync_with_stdio(false);
    solve();
    return 0;
}


#include <iostream>
#include <sstream>
#include <cstdio>
#include <vector>
#include <string>
#include <algorithm>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <queue>
#include <utility>
#include <cassert>
#include <numeric>
#include <sstream>
using namespace std;

#define REQUIRE(cond, message) \
    do { \
        if (!(cond)) { \
            std::cerr << message << std::endl; \
            assert(false); \
        } \
    } while (false)

#define forn(i, n) for (int i = 0; i < int(n); ++i)
#define for1(i, n) for (int i = 1; i <= int(n); ++i)
#define forv(i, v) forn(i, (v).size())
#define pb push_back
#define mp make_pair
#define all(v) (v).begin(), (v).end()

typedef vector<int> vi;
typedef vector<vi> vvi;
typedef long long ll;
typedef vector<ll> vl;
typedef pair<int, int> pii;
typedef vector<string> vs;
typedef long double ld;

vi toBinary(ll x, int len = 0)
{
    vi ret;
    while (x > 0) {
        ret.pb(x & 1);
        x >>= 1;
    }
    if (len > 0) ret.resize(len);
    reverse(all(ret));
    return ret;
}

const size_t UNDEFINED = std::numeric_limits<size_t>::max();

class Trie
{
public:
    explicit Trie(size_t reserveSize)
    {
        next_.reserve(reserveSize);
        next_.emplace_back(2, UNDEFINED);
    }

    size_t next(size_t id, size_t type) const
    {
        return next_.at(id).at(type);
    }

    size_t add(size_t id, size_t type)
    {
        if (next_.at(id).at(type) == UNDEFINED) {
            next_.at(id).at(type) = next_.size();
            next_.emplace_back(2, UNDEFINED);
        }
        return next_.at(id).at(type);
    }

    size_t root() const { return 0; }

private:
    typedef std::vector<size_t> Children;
    std::vector<Children> next_;
};

void add(Trie& trie, const vi& a)
{
    size_t node = trie.root();
    for (int type : a) {
        node = trie.add(node, type);
    }
}

void solve()
{
    int n;
    cin >> n;
    vl a(n);
    forn(i, n) cin >> a[i];
    int len = toBinary(*max_element(all(a))).size();
    ll suffixXor = accumulate(all(a), 0LL, [](ll a, ll b) { return a ^ b; });
    ll prefixXor = 0;
    ll ans = 0;
    Trie trie(n * len);
    add(trie, vi(len, 0));
    forn(i, n + 1) {
        vi candidate = toBinary(suffixXor, len);
        size_t node = trie.root();
        for (int& type : candidate) {
            if (trie.next(node, type ^ 1) != UNDEFINED) {
                node = trie.next(node, type ^ 1);
                type = 1;
            } else {
                node = trie.next(node, type);
                type = 0;
            }
        }
        ll cand = 0;
        for (int c : candidate) {
            cand = cand * 2 + c;
        }
        ans = max(ans, cand);
        if (i < n) {
            suffixXor ^= a[i];
            prefixXor ^= a[i];
        }
        add(trie, toBinary(prefixXor, len));
    }
    cout << ans << endl;
}

int main()
{
    ios_base::sync_with_stdio(false);
    solve();
    return 0;
}