//MMA Contest 015 B
#include<bits/stdc++.h>
using namespace std;
typedef int64_t ll;

int main(){
  string A,B; cin>>A>>B;
  reverse(A.begin(),A.end());
  reverse(B.begin(),B.end());
  while(A.size()>B.size())B.push_back('0');
  while(B.size()>A.size())A.push_back('0');
  int a=1,ans=0;
  for(int i=0;i<(int)A.size();i++){
    //if(B.at(i)=='1')A.at(i)='1';
    if(A.at(i)!=B.at(i))ans+=a;
    a*=2;
  }
  cout<<ans<<endl;
  return 0;
}