#include <bits/stdc++.h>
using namespace std;

int tinhKhoangCach(int m, int n)
{
	int ret = 0;
	//TODO
	while(m !=0 || n!=0)
	{
		int dvM = m%10;
		int dvN = n%10;
		
		ret += abs(dvM -  dvN);
		m = m/10;
		n = n/10;
	}
	return ret;
}

int main()
{
	int m = 12345;
	int n = 31;
	int kc = tinhKhoangCach(m,n);
	cout << "hihi";
}
