/*               ∧∧∩               ( ゚∀゚)/ キタ━━━━━━(゚∀゚)━━━━━━!!!!             ⊂   ノ  ゆっくり見てってね!!!!!!!!              (つ ノ     o          (ノ      \      ☆              |      o           (⌒ ⌒ヽ   /     ☆     \  (´⌒  ⌒  ⌒ヾ   /       ('⌒ ; ⌒   ::⌒  )      (´     )     ::: ) /   ☆─ (´⌒;:    ::⌒`) :;  ) */ #include using namespace std; #define rep(i, s, n) for (int i = (s); i < (int)(n); i++) typedef long long ll; #define _GLIBCXX_DEBUG // 文字列(2進数表記)→10進数 ll binaryToDecimal(const string& binary) { ll decimal = 0; ll power = 1; // 逆順に処理するため、文字列を反転させる string reversedBinary(binary.rbegin(), binary.rend()); for (char bit : reversedBinary) { if (bit == '1') { decimal += power; } power *= 2; } return decimal; } int main() { ios::sync_with_stdio(false); std::cin.tie(nullptr); string s, t; cin >>s >> t; if(s > t) swap(s, t); while(s.size() < t.size()) { s = '0' + s; } string ans = ""; rep(i, 0, s.size()) { if(s[i] == '1') { if(t[i] == '0')ans += '1'; else ans += '0'; } else { if(t[i] == '0') ans += '0'; else ans += '1'; } } ll z = binaryToDecimal(ans); cout << z << endl; }