#include <bits/stdc++.h>
double const PI = 4 * atan(1.0);
using namespace std;
void OPEN() {
  freopen("A.in", "r", stdin);
  freopen("A.out", "w", stdout);
}
int a;
int f[6] = {0, 2, 3, 1, 2, 1};
int main() {
  scanf("%d", &a);
  printf("%d", f[a]);
}
