#!/usr/bin/python3
print('y=应用层,b=表示层,h=会话层,c=传输层,wa=网络层,s=数据链路层,wu=物理层')
print('请输入答案,以空格隔开:')
while True:
	b=[-1,-1,-1,-1,-1,-1,-1]
	a=input().split()
	if a[0]=='exit' : break;
	if a[0]=='js':
		c=eval(a[1])
		print (c)
		continue
	for i in range(0,len(a)):
		#print(a[i])
		if a[i]=='y':b[i]=1
		if a[i]=='b':b[i]=2
		if a[i]=='h':b[i]=3
		if a[i]=='c':b[i]=4
		if a[i]=='wa':b[i]=5
		if a[i]=='s':b[i]=6
		if a[i]=='wu':b[i]=7
	print(b)
	score=0
	for i in range(0,7):
		for j in range(i+1,7):
			if(b[i]<b[j]):
				score+=1
	print('得分:',score)