https://www.acmicpc.net/problem/1105
#include<stdio.h>
#include<string.h>
int main() {
int a,b;
scanf("%d %d",&a,&b);
char l[12];
char r[12];
sprintf(l,"%d",a);
sprintf(r,"%d",b);
int num=0;
if(strlen(l)==strlen(r)){
for(int i=0;i<strlen(l);i++){
if(l[i]==r[i] && l[i]=='8') num++;
else if(l[i] != r[i]) break;
}
}
printf("%d",num);
}