#include <bits/stdc++.h>
#define ll long long
#define F first
#define S second
#define endl '\n'
#define Endl '\n'
using namespace std;
const int N = 2e5 + 5;
int tc, n, m, a[N];
random_device rd;
mt19937 eng(rd());
int getRandomNumberInRange(int min, int max) {
uniform_int_distribution<> distribution(min, max);
return distribution(eng);
}
ll getAnswer(ll n) {
for (ll i = 1; i <= 10; i++) {
ll cur = i * n;
if (cur % 10 == 0) {
return i;
}
}
return 0;
}
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0); // cout.tie(0);
cin >> n;
cout << getAnswer(n) << endl;
return 0;
}