#include <iostream>
using namespace std;
int main(){
int N = 0 ;
while(cin >> N){
if(N > 10000 || N == 0)
return 0 ;
int A[N] = {};
int sum = 0;
int maximum = 0;
for(int i = 0 ; i < N ; i++){
sum += A[i];
if(sum < 0)
sum = 0;
if(sum >= maximum)
maximum = sum ;
}
if(maximum == 0){
cout << "Losing streak.";
}else{
cout << "The maximum winning streak is " << maximum << "." << endl;
}
}
}