https://www.acmicpc.net/problem/1105
using System;
class Program
{
static void Main() {
string[] s=Console.ReadLine().Split(' ');
string l=s[0];
string r=s[1];
int num=0;
if(l.Length==r.Length){
for(int i=0;i<l.Length;i++){
if(l[i]==r[i] && l[i]=='8') num++;
else if(l[i] != r[i]) break;
}
}
Console.Write(num);
}
}