"use strict";

function main(input) {
  input = input.trim().split("\n");
  if (input[0] == "1") {
    if (input[1] == "2") {
      console.log(3);
      return;
    } else {
      console.log(2);
      return;
    }
  } else if (input[0] == "2") {
    if (input[1] == "1") {
      console.log(3);
      return;
    } else {
      console.log(1);
      return;
    }
  } else {
    if (input[1] == "1") {
      console.log(2);
      return;
    } else {
      console.log(1);
      return;
    }
  }
}

main(require("fs").readFileSync("/dev/stdin", "utf-8"));
