#include <iostream>
using namespace std;


int cambios_paridad_digitos(int n, int b);


int main() {
  int n, b;
  while (cin >> n >> b) cout << cambios_paridad_digitos(n, b) << endl;

  return 0;
}
