#include <iostream>
#include <string>
#include <algorithm>
#include <cstdio>
#include <vector>
#include <queue>
#include <set>
#include <numeric>
#include <cmath>

using namespace std;

typedef long long int lld;

const lld mod = 1e9+7;
const lld INF = 1e9;
//const lld MAXN = 1e9;

int main()
{
	string a,b;
	while(cin>>a>>b)
	{
		int cnt = 0;
		for(int i = 0; i < a.size(); i++)
		{
			if (a[i]!='0')
			{
				cnt++;
			}
		}
		for(int i = 0; i < b.size(); i++)
		{
			if (b[i]!='0')
			{
				cnt++;
			}
		}
		cout << cnt << endl;
	}

	return 0;
}