#include <inttypes.h>
#include <stdio.h>

typedef union
{
  struct
  {
    #define BITG(n) uint8_t bit##n : 1
    BITG(0);
    BITG(1);
    BITG(2);
    BITG(3);
    BITG(4);
    BITG(5);
    BITG(6);
    BITG(7);
    #undef BITG
  } bits;
  uint8_t value;
}getbit;

uint8_t bit_sum(uint8_t, uint8_t);


uint8_t bit_sum(uint8_t a, uint8_t b)
{
  getbit op1, op2, opr;
  uint8_t carry;
  op1.value=a; op2.value=b;
  #define OP1(n) op1.bits.bit##n
  #define OP2(n) op2.bits.bit##n
  #define OPR(n) opr.bits.bit##n
  #define XOR(a,b) ((a)^(b))
  #define AND(a,b) ((a)&(b))
  OPR(0) = XOR(OP1(0), OP2(0));
  carry = AND(OP1(0), OP2(0));
  #define SETBIT(n)                \
  OPR(n) = XOR                     \
           (                       \
             carry,                \
             XOR(OP1(n), OP2(n))   \
           );

  #define CARRYBIT(n)              \
  carry = XOR                      \
          (                        \
            AND(OP1(n), OP2(n)),   \
            AND                    \
            (                      \
              XOR(OP1(n), OP2(n)), \
              carry                \
            )                      \
          );
  SETBIT(1);
  CARRYBIT(1);
  SETBIT(2);
  CARRYBIT(2);
  SETBIT(3);
  CARRYBIT(3);
  SETBIT(4);
  CARRYBIT(4);
  SETBIT(5);
  CARRYBIT(5);
  SETBIT(6);
  CARRYBIT(6);
  SETBIT(7);
  return opr.value;
  #undef SETBIT
  #undef CARRYBIT
  #undef OP1
  #undef OP2
  #undef OPR
  #undef XOR
  #undef AND
}

int main (int argc, char *argv[], char *envp[])
{
  uint8_t a, b, c;
  scanf ("%"SCNu8"%"SCNu8, &a, &b);
  c = bit_sum(a,b);
  printf("%"PRIu8"\n", c);
  return 0;
}