In regard to Kittsil's answer, here is my complete solution.
I'm not sure if it's completely correct, but it seems to work for me.
ushort n = (ushort)s.Length;
ushort m = (ushort)t.Length;
ushort[,] d = new ushort[n + 1, m + 1];
// Step 1
if (n == 0)
{
return m;
}
if (m == 0)
{
return n;
}
// Step 2
d[0, 0] = 0;
for (int i = 1; i <= n; i++)
{
if ('0' <= s[i - 1] && s[i - 1] <= '9')
d[i, 0] = (ushort)(d[i - 1, 0] + 200);
else
d[i, 0] = (ushort)(d[i - 1, 0] + 1);
}
for (int j = 1; j <= m; j++)
{
if ('0' <= t[j - 1] && t[j - 1] <= '9')
d[0, j] = (ushort)(d[0, j - 1] + 200);
else
d[0, j] = (ushort)(d[0, j - 1] + 1);
}
// Step 3
for (int i = 1; i <= n; i++)
{
//Step 4
for (int j = 1; j <= m; j++)
{
// Step 5
bool isIdentical = t[j - 1] == s[i - 1];
bool isNumber = ('0' <= t[j - 1] && t[j - 1] <= '9') || ('0' <= s[i - 1] && s[i - 1] <= '9');
int cost1 = isIdentical ? 0 : (isNumber ? 200 : 1);
int cost2 = isNumber ? 200 : 1;
// Step 6
d[i, j] = (ushort)(Math.Min(Math.Min(d[i - 1, j] + cost2, d[i, j - 1] + cost2), d[i - 1, j - 1] + cost1));
}
}
// Step 7
return d[n, m];