#include <fstream>
#include <string>

using namespace std;

ifstream input("Bai1_15.inp");
ofstream output("Bai1_15.out");
string a, b;

int ABS(int a)
{
	return (a >= 0) ? a : -a;
}

int main()
{
	input >> a >> b;
	int diff = ABS(a.size() - b.size());
	int res = 0;
	if (a.size() > b.size())
	{
		for (int i = 1; i <= diff; ++i)
		{
			b = '0' + b;
		}
	}
	else if (a.size() < b.size())
	{
		for (int i = 1; i <= diff; ++i)
		{
			a = '0' + a;
		}
	}
	for (int i = 0; i < a.size(); ++i)
	{
		res += ABS(a[i] - b[i]);
	}
	output << res;
	input.close();
	output.close();
	return 0;
}