public class Euler820 {

    static long powMod10(long exp, long mod) {
        long base = 10 % mod;
        long res = 1 % mod;
        while (exp > 0) {
            if ((exp & 1L) == 1L) {
                res = (res * base) % mod;
            }
            base = (base * base) % mod;
            exp >>= 1L;
        }
        return res;
    }

    static int nthDigitReciprocal(long n, long k) {
        long r = powMod10(n - 1, k);
        return (int) ((10L * r) / k);
    }

    static long S(long n) {
        long ans = 0;
        for (long k = 1; k <= n; ++k) {
            ans += nthDigitReciprocal(n, k);
        }
        return ans;
    }

    public static String solve() {
        return Long.toString(S(10000000L));
    }

    public static void main(String[] args) {
        System.out.println(solve());
    }
}
