while(0<1)println((for(c<-readLine;n<-"06988"if c==n)yield 1).sum)