





import numpy as np

def     UpperCAmelCase_						(						_UpperCAmelCase       :Any     ,	_UpperCAmelCase       :Union[str, Any]     ,	_UpperCAmelCase       :Tuple							)  ->							List[Any]:
     '''simple docstring'''


     A_					      =  n_draws * class_counts / class_counts.sum()
     # floored means we don't overshoot n_samples, but probably undershoot
     A_					      =  np.floor(_UpperCAmelCase							)
     # we add samples according to how much "left over" probability
     # they had, until we arrive at n_samples
     A_					      =  int(n_draws - floored.sum()							)
     if need_to_add > 0:
          A_					      =  continuous - floored
          A_					      =  np.sort(np.unique(_UpperCAmelCase							)							)[::-1]
          # add according to remainder, but break ties
          # randomly to avoid biases
          for value in values:
               ((A_    )      ,						    )					      =  np.where(remainder == value							)
               # if we need_to_add less than what's in inds
               # we draw randomly from them.
               # if we need to add more, we add them all and
               # go to the next value
               A_					      =  min(len(_UpperCAmelCase							)     ,	_UpperCAmelCase							)
               A_					      =  rng.choice(_UpperCAmelCase     ,	size=_UpperCAmelCase     ,	replace=_UpperCAmelCase							)
               floored[inds] += 1
               need_to_add -= add_now
               if need_to_add == 0:
                    break
     return floored.astype(np.intaa							)


def     UpperCAmelCase_						(						_UpperCAmelCase       :List[str]     ,	_UpperCAmelCase       :int     ,	_UpperCAmelCase       :List[str]     ,	_UpperCAmelCase       :List[str]     ,	_UpperCAmelCase       :Optional[int]=10							)  ->							List[Any]:
     '''simple docstring'''


     A_      ,						A_					      =  np.unique(_UpperCAmelCase     ,	return_inverse=_UpperCAmelCase							)
     A_					      =  classes.shape[0]
     A_					      =  np.bincount(_UpperCAmelCase							)
     if np.min(_UpperCAmelCase							) < 2:
          raise ValueError('''Minimum class count error'''							)
     if n_train < n_classes:
          raise ValueError(
              '''The train_size = %d should be greater or ''' '''equal to the number of classes = %d''' % (n_train, n_classes)							)
     if n_test < n_classes:
          raise ValueError(
              '''The test_size = %d should be greater or ''' '''equal to the number of classes = %d''' % (n_test, n_classes)							)
     A_					      =  np.split(np.argsort(_UpperCAmelCase     ,	kind='''mergesort'''							)     ,	np.cumsum(_UpperCAmelCase							)[:-1]							)
     for _ in range(_UpperCAmelCase							):
          A_					      =  approximate_mode(_UpperCAmelCase     ,	_UpperCAmelCase     ,	_UpperCAmelCase							)
          A_					      =  class_counts - n_i
          A_					      =  approximate_mode(_UpperCAmelCase     ,	_UpperCAmelCase     ,	_UpperCAmelCase							)

          A_					      =  []
          A_					      =  []

          for i in range(_UpperCAmelCase							):
               A_					      =  rng.permutation(class_counts[i]							)
               A_					      =  class_indices[i].take(_UpperCAmelCase     ,	mode='''clip'''							)
               train.extend(perm_indices_class_i[: n_i[i]]							)
               test.extend(perm_indices_class_i[n_i[i] : n_i[i] + t_i[i]]							)
          A_					      =  rng.permutation(_UpperCAmelCase							)
          A_					      =  rng.permutation(_UpperCAmelCase							)

          yield train, test










def     UpperCAmelCase_						(						_UpperCAmelCase       :int = 1000							)  ->							int:
     '''simple docstring'''


     A_					      =					[0, 3, 3, 5, 4, 4, 3, 5, 5, 4, 3, 6, 6, 8, 8, 7, 7, 9, 8, 8]
     # number of letters in twenty, thirty, ..., ninety (0 for numbers less than
     # 20 due to inconsistency in teens)
     A_					      =					[0, 0, 6, 6, 5, 5, 5, 7, 6, 6]

     A_					      =					0

     for i in range(1     ,	n + 1							):
          if i < 1000:
               if i >= 100:
                    # add number of letters for "n hundred"
                    count += ones_counts[i // 100] + 7

                    if i % 100 != 0:
                         # add number of letters for "and" if number is not multiple
                         # of 100
                         count += 3

               if 0 < i % 100 < 20:
                    # add number of letters for one, two, three, ..., nineteen
                    # (could be combined with below if not for inconsistency in
                    # teens)
                    count += ones_counts[i % 100]
               else:
                    # add number of letters for twenty, twenty one, ..., ninety
                    # nine
                    count += ones_counts[i % 10]
                    count += tens_counts[(i % 100 - i % 10) // 10]
          else:
               count += ones_counts[i // 1000] + 8
     return count


if __name__ == "__main__":
      print(solution(int(input().strip())))



