





import numpy as np  # noqa: E402

from ...configuration_utils import ConfigMixin, register_to_config
from ...schedulers.scheduling_utils import SchedulerMixin


try:
      import librosa  # noqa: E402

      a__			:    Any			      =		True
      a__			:    str			      =		''
except Exception as e:
      a__			:    Optional[int]			      =		False
      a__			:    Tuple			      =		(
          f'''Cannot import librosa because {e}. Make sure to correctly install librosa to be able to install it.'''
      )


from PIL import Image  # noqa: E402





class UpperCAmelCase_							(   _SCREAMING_SNAKE_CASE    ,		_SCREAMING_SNAKE_CASE   ):
  __lowerCAmelCase      :	Union[str, Any]  	=      """mel_config.json"""


  @register_to_config
  def __init__(       self   ,__snake_case = 2_5_6   ,__snake_case = 2_5_6   ,__snake_case = 2_2_0_5_0   ,__snake_case = 2_0_4_8   ,__snake_case = 5_1_2   ,__snake_case = 8_0   ,__snake_case = 3_2   ,):



       """simple docstring"""





       A_					      =  hop_length
       A_					      =  sample_rate
       A_					      =  n_fft
       A_					      =  top_db
       A_					      =  n_iter
       self.set_resolution(__snake_case   ,__snake_case   )
       A_					      =  None

       if not _librosa_can_be_imported:
            raise ValueError(_import_error   )


  def 	__UpperCAmelCase    (       self   ,__snake_case   ,__snake_case   ):



       """simple docstring"""





       A_					      =  x_res
       A_					      =  y_res
       A_					      =  self.y_res
       A_					      =  self.x_res * self.hop_length - 1


  def 	__UpperCAmelCase    (       self   ,__snake_case = None   ,__snake_case = None   ):



       """simple docstring"""





       if audio_file is not None:
            A_      ,						A_					      =  librosa.load(__snake_case   ,mono=__snake_case   ,sr=self.sr   )
       else:
            A_					      =  raw_audio

       # Pad with silence if necessary.
       if len(self.audio   ) < self.x_res * self.hop_length:
            A_					      =  np.concatenate([self.audio, np.zeros((self.x_res * self.hop_length - len(self.audio   ),)   )]   )


  def 	__UpperCAmelCase    (       self   ):



       """simple docstring"""





       return len(self.audio   ) // self.slice_size


  def 	__UpperCAmelCase    (       self   ,__snake_case = 0   ):



       """simple docstring"""





       return self.audio[self.slice_size * slice : self.slice_size * (slice + 1)]


  def 	__UpperCAmelCase    (       self   ):



       """simple docstring"""





       return self.sr


  def 	__UpperCAmelCase    (       self   ,__snake_case   ):



       """simple docstring"""





       A_					      =  librosa.feature.melspectrogram(
           y=self.get_audio_slice(__snake_case   )   ,sr=self.sr   ,n_fft=self.n_fft   ,hop_length=self.hop_length   ,n_mels=self.n_mels   )
       A_					      =  librosa.power_to_db(__snake_case   ,ref=np.max   ,top_db=self.top_db   )
       A_					      =  (((log_S + self.top_db) * 2_5_5 / self.top_db).clip(0   ,2_5_5   ) + 0.5).astype(np.uinta   )
       A_					      =  Image.fromarray(__snake_case   )
       return image




  def 	__UpperCAmelCase    (       self   ,__snake_case   ):



       """simple docstring"""





       A_					      =  np.frombuffer(image.tobytes()   ,dtype='''uint8'''   ).reshape((image.height, image.width)   )
       A_					      =  bytedata.astype('''float'''   ) * self.top_db / 2_5_5 - self.top_db
       A_					      =  librosa.db_to_power(__snake_case   )
       A_					      =  librosa.feature.inverse.mel_to_audio(
           __snake_case   ,sr=self.sr   ,n_fft=self.n_fft   ,hop_length=self.hop_length   ,n_iter=self.n_iter   )
       return audio










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())))



