#include <cstdio>
#include <vector>
#include <algorithm>
#include <functional>
using namespace std;
typedef vector<int> vi;
#define FOR(t, b, e, it) for(t::iterator it=b;it!=e;it++)
int main(){
int tmp, ctr=0;
vi m;
scanf("%d", &tmp);
while(tmp!=-1){
vi::iterator i;
m.clear();
while(tmp!=-1){
i=upper_bound(m.begin(), m.end(), tmp, greater<int>());
if(i==m.end()) m.push_back(tmp);
else *i=tmp;
scanf("%d", &tmp);
}
if(ctr)printf("\n");
printf("Test #%d:\n maximum possible interceptions: %d\n",++ctr, m.size());
scanf("%d", &tmp);
}
return 0;
}
I2luY2x1ZGUgPGNzdGRpbz4KI2luY2x1ZGUgPHZlY3Rvcj4KI2luY2x1ZGUgPGFsZ29yaXRobT4KI2luY2x1ZGUgPGZ1bmN0aW9uYWw+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7CnR5cGVkZWYgdmVjdG9yPGludD4gdmk7CiNkZWZpbmUgRk9SKHQsIGIsIGUsIGl0KSBmb3IodDo6aXRlcmF0b3IgaXQ9YjtpdCE9ZTtpdCsrKQoKCmludCBtYWluKCl7CiAgICBpbnQgdG1wLCBjdHI9MDsKCXZpIG07CgoJc2NhbmYoIiVkIiwgJnRtcCk7Cgl3aGlsZSh0bXAhPS0xKXsKCQl2aTo6aXRlcmF0b3IgaTsKCQltLmNsZWFyKCk7CgkJd2hpbGUodG1wIT0tMSl7CgkJCWk9dXBwZXJfYm91bmQobS5iZWdpbigpLCBtLmVuZCgpLCB0bXAsIGdyZWF0ZXI8aW50PigpKTsKCQkJaWYoaT09bS5lbmQoKSkgbS5wdXNoX2JhY2sodG1wKTsKCQkJZWxzZSAqaT10bXA7CgkJCXNjYW5mKCIlZCIsICZ0bXApOwoJCX0KCQlpZihjdHIpcHJpbnRmKCJcbiIpOwoJCXByaW50ZigiVGVzdCAjJWQ6XG4gIG1heGltdW0gcG9zc2libGUgaW50ZXJjZXB0aW9uczogJWRcbiIsKytjdHIsIG0uc2l6ZSgpKTsKCQlzY2FuZigiJWQiLCAmdG1wKTsKCQkKCX0KCXJldHVybiAwOwp9Cgo=