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