#include <bits/stdc++.h>
using namespace std;
int main()
{
	freopen("bai1_15.inp", "r", stdin);
	freopen("bai1_15.out", "w", stdout);
 	int a,b;
 	cin>>a>>b;
 	int c,d;
 	int h=0;
 	while (a!=0 || b!=0)
 	{
 		c=a%10;
 		a=a/10;
 		d=b%10;
 		b=b/10;
 		h=abs(c-d) + h;
	}
	cout<<h;
}
