using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace 约德尔测试
{
class Program
{
staticvoid Main(string[] args)
{
string a = Console.ReadLine();
string b = Console.ReadLine();
int[] num1 = newint[a.Length];
int[] num2 = newint[b.Length];
int i = 0;
foreach (char c in b)
{
num2[i] = c - '0';
i++;
}
i = 0;
foreach (char c in a)
{
if ((c >= '0' && c <= '9') || (c >= 'a' && c <= 'z'))
{
num1[i] = 1;
}
else
num1[i] = 0;
i++;
}
double count = 0;
for (i = 0; i < a.Length; i++)
{
if (num1[i] == num2[i])
count++;
}
Console.WriteLine("{0:F2}%",count/a.Length*100);
Console.ReadLine();
}
}
}