#include <stdio.h>

int main()
{
  int B, B0, n=0, p=1, b;

  scanf("%d", &B0);
  B=B0;

  while (B>0) {
    b = B%10; B /= 10;
    n = n + b*p;
    p *= 2;
  }
  printf("(%d)_2 = %d\n", B0, n);

  return 0;
}
