#include <bits/stdc++.h>
int x;
int main() {
  scanf("%d", &x);
  switch (x) {
    case 1:
      printf("2");
      return 0;
    case 2:
      printf("3");
      return 0;
    case 3:
      printf("1");
      return 0;
    case 4:
      printf("2");
      return 0;
    case 5:
      printf("1");
      return 0;
  }
  return 0;
}
