#include using namespace std; using ll = long long; #define rep(i, s, e) for (int i = (int)(s); i < (int)(e); ++i) int main() { cin.tie(nullptr); ios_base::sync_with_stdio(false); string X; cin >> X; ll A = 0, B = 1; bool find = false; for (char c : X) { if (c == '.') find = true; else { A *= 10; A += c - '0'; if (find) B *= 10; } } int ans = 0; while (true) { ++ans; ll temp = A; A = B % A; B = temp; if (A == 0) break; } cout << ans << '\n'; }