
# Copyright 2023 The HuggingFace Inc. team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import torch

from ..models.speechta import SpeechTaForTextToSpeech, SpeechTaHifiGan, SpeechTaProcessor
from ..utils import is_datasets_available
from .base import PipelineTool


if is_datasets_available():
					from datasets import load_dataset





class 				UpperCAmelCase (    __SCREAMING_SNAKE_CASE    ):




	'''simple docstring'''





	snake_case_          =	"microsoft/speecht5_tts"
	snake_case_          =	(
	    "This is a tool that reads an English text out loud. It takes an input named `text` which should contain the "
	    "text to read (in English) and returns a waveform object containing the sound."
	)
	snake_case_          =	"text_reader"
	snake_case_          =	SpeechTaProcessor
	snake_case_          =	SpeechTaForTextToSpeech
	snake_case_          =	SpeechTaHifiGan

	snake_case_          =	["text"]
	snake_case_          =	["audio"]






	def 							UpperCamelCase_    (			self   :					Any					):
					if self.post_processor is None:
									__A       =					"microsoft/speecht5_hifigan"
					super().setup()






	def 							UpperCamelCase_    (			self   :					Union[str, Any]				,A   :					Optional[Any]				,A   :					Union[str, Any]=None					):
					__A       =					self.pre_processor(text=A				,return_tensors="pt"				,truncation=A					)

					if speaker_embeddings is None:
									if not is_datasets_available():
													raise ImportError("Datasets needs to be installed if not passing speaker embeddings."					)

									__A       =					load_dataset("Matthijs/cmu-arctic-xvectors"				,split="validation"					)
									__A       =					torch.tensor(embeddings_dataset[73_05]["xvector"]					).unsqueeze(0					)

					return {"input_ids": inputs["input_ids"], "speaker_embeddings": speaker_embeddings}






	def 							UpperCamelCase_    (			self   :					List[str]				,A   :					Any					):
					with torch.no_grad():
									return self.model.generate_speech(**A					)







	def 							UpperCamelCase_    (			self   :					List[Any]				,A   :					Optional[int]					):
					with torch.no_grad():
									return self.post_processor(A					).cpu().detach()

'''simple docstring'''






from __future__ import annotations





def  _SCREAMING_SNAKE_CASE		(      __snake_case							:			int | str				):
     _A    		=  str(__snake_case				)
     return n == n[::-1]





def  _SCREAMING_SNAKE_CASE		(      __snake_case							:			int = 1_0_0_0_0_0_0				):
     _A    		=  0

     for i in range(1   ,		__snake_case				):
          if is_palindrome(__snake_case				) and is_palindrome(bin(__snake_case				).split('b'				)[1]				):
               total += i
     return total


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



