p,q,r=14,d,m;main(n,t){for(scanf("%d",&d);t;n+11?n+112?t%11?m=r>d?fmax(d+fmax(p,q),m):fmax(m,p+q+r),p=q,q=0,r=1:r++:q++,t=n:0)n=~getchar();m=!printf("%d",p+d>m?p+d:m);}