Yule Lads

Some Yule Lads skip their night; each remaining visitor K toggles every house whose number is a multiple of K, and exactly one set of absent Lads leaves all houses except house 1 lit. Count who came.

Medium6Number theoryMathBrute forceImplementationNo attempts yetTime limit1sMemory limit1024 MB

Problem

The children of Iceland are lucky. They do not have just one Santa Claus, they have NN of them! They are called the Yule Lads, and on each of the NN nights before Christmas one of them comes to town, bringing a small gift to children who have been nice and a potato to children who have been naughty.

On a street in a small Icelandic town there are NN houses, numbered from 11 to NN. Every house is beautifully decorated with Christmas lights, and in the beginning all the lights are on.

On each of the NN nights before Christmas, one of the Yule Lads visits this street. The Yule Lad who visits KK nights before Christmas is very fond of the number KK, so he only visits houses whose number is a multiple of KK. The Yule Lads are also troublemakers: in every house they visit they toggle the Christmas lights, turning them off if they are on and on if they are off.

But some of the Yule Lads felt sick and never came to town. On Christmas day the lights of every house except house 11 were on. How many Yule Lads came to town?

An integer pp is a multiple of an integer qq when the division p/qp/q leaves no remainder.

Input

The first line contains a positive integer NN, the number of Yule Lads and the number of houses on the street (1N10131 \le N \le 10^{13}).

Output

Print a single integer, the number of Yule Lads that came to town. You may assume there is exactly one scenario in which every house except house 11 has its lights on.

Hint

Consider the case N=6N = 6. There are six houses on the street, and here is what happens on each of the six nights before Christmas, assuming no Yule Lad is sick.

  • Six nights before Christmas, the Yule Lad turns the lights at house 66 off.
  • Five nights before Christmas, the Yule Lad turns the lights at house 55 off.
  • Four nights before Christmas, the Yule Lad turns the lights at house 44 off.
  • Three nights before Christmas, the Yule Lad turns the lights at house 33 off and the lights at house 66 on.
  • Two nights before Christmas, the Yule Lad turns the lights at houses 22 and 66 off and the lights at house 44 on.
  • The night before Christmas, the Yule Lad turns the lights at houses 11 and 44 off and the lights at houses 22, 33, 55 and 66 on.

But then house 44 would have its lights off on Christmas day, contrary to what actually happened.

If instead only the Yule Lad due four nights before Christmas is sick, then every house except house 11 has its lights on on Christmas day. The answer is therefore 55: the Yule Lads who came to town are the ones due 66, 55, 33, 22 and 11 nights before Christmas.