{-# LANGUAGE BangPatterns #-} zeta :: Int -> Int -> Double zeta a x = (\d -> 1.0 / (fromIntegral d)) $ last $ takeWhile (<= 1000000000000) $ take (x - 1) $ iterate ((* a)) (a - 1) main :: IO () main = do x <- readLn :: IO Int if x == 2 then putStrLn "1000000" else print $ floor $ (* 1000000) $ sum $ map (\a -> zeta a x) [2..1000000]