while 1:s=raw_input().upper();_=len(s)-4;print _<1and-1or-sum(map(str.find,'LI'+'N'*_+'UX',s))