fin=open("in19_5.txt",'r') deg=int(fin.readline()) v=fin.readline().split(" ") ver=[] totaldeg=0 for i in range(0,len(v)): n=fin.readline().split(" ") c=n.count('1')+n.count('1\n') totaldeg=c+totaldeg if(c>deg): ver.append(n[0]) fout=open("out_35_19_5.txt",'w') fout.write("VERTICES GREATER THAN DEGREE 2:"+str(ver)) fout.write("\n TOTAL DEGREE:"+str(totaldeg))