#include<bits/stdc++.h>
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define rep2(i, m, n) for(int i = (int)(m); i < (int)(n); i++)
#define rep_inv(i, n, m) for(int i = (int)(n); i > (int)(m); i--)
using namespace std;
using ll = long long;
using vl = vector<ll>;
using vc = vector<char>;
using vvl = vector<vl>;
using vvc = vector<vc>;
using pll = pair<ll, ll>;
using vpll = vector<pll>;

int main(){
  ll N;
  cin >> N;

  vc S;

  if(N == 0){
    cout << 0 << endl;
    return 0;
  }
  
  while(N != 0){
    if(N % (-2) == 0){
      S.push_back('0');
    } else{
      S.push_back('1');
      N--;
    }

    N /= -2;
  }

  rep_inv(i, S.size() - 1, -1) cout << S[i];

  cout << "\n";
  
  return 0;
}

#include <bits/stdc++.h>
using namespace std; 
int main() {
  int A;
  int B;
  cin>>A>>B;
  int i=0;
  int j=B-A;
  int sum=0;
  int C=A;
  while(i<=j){
    A=C;
    int a=A%10;//A=12345の時5
    A/=10;//A=1234
    int b=A%10;
    A/=10;//A=123
    A/=10;//A=12
    int d=A%10;
    A/=10;//A=1
    int e=A;
    if(a==e&&b==d){
      sum+=1;
    }
    C++;
    i++;
  }
  cout<<sum<<endl;

}
