

'''simple docstring'''
import os
from pathlib import Path
from unittest.mock import patch

import pytest
import zstandard as zstd

from datasets.download.download_config import DownloadConfig
from datasets.utils.file_utils import (
    OfflineModeIsEnabled,
    cached_path,
    fsspec_get,
    fsspec_head,
    ftp_get,
    ftp_head,
    get_from_cache,
    http_get,
    http_head,
)


_snake_case         =  '\\n    Text data.\n    Second line of data.'

_snake_case         =  'file'







@pytest.fixture(scope="session"					)
def  _A		(     snake_case					)      ->     Optional[int]:
   _lowercase      :				Union[str, Any]      					=       tmp_path_factory.mktemp("data"					) / (FILE_PATH + ".zstd")
   _lowercase      :				Any      					=       bytes(snake_case		,							"utf-8"					)
   with zstd.open(snake_case		,							"wb"					) as f:
      f.write(snake_case					)
   return path







@pytest.fixture
def  _A		(     snake_case					)      ->     Tuple:
   with open(os.path.join(tmpfs.local_root_dir		,							snake_case					)		,							"w"					) as f:
      f.write(snake_case					)
   return FILE_PATH







@pytest.mark.parametrize("compression_format"		,							["gzip", "xz", "zstd"]					)
def  _A		(     snake_case		,							snake_case		,							snake_case		,							snake_case		,							snake_case		,							snake_case					)      ->     Optional[int]:
   _lowercase      :				Dict      					=       {"gzip": gz_file, "xz": xz_file, "zstd": zstd_path}
   _lowercase      :				List[str]      					=       input_paths[compression_format]
   _lowercase      :				List[str]      					=       tmp_path / "cache"
   _lowercase      :				Any      					=       DownloadConfig(cache_dir=snake_case		,							extract_compressed_file=snake_case					)
   _lowercase      :				List[str]      					=       cached_path(snake_case		,							download_config=snake_case					)
   with open(snake_case					) as f:
      _lowercase      :				List[Any]      					=       f.read()
   with open(snake_case					) as f:
      _lowercase      :				str      					=       f.read()
   assert extracted_file_content == expected_file_content







@pytest.mark.parametrize("default_extracted"		,							[True, False]					)
@pytest.mark.parametrize("default_cache_dir"		,							[True, False]					)
def  _A		(     snake_case		,							snake_case		,							snake_case		,							snake_case		,							snake_case					)      ->     Any:
   _lowercase      :				Any      					=       "custom_cache"
   _lowercase      :				str      					=       "custom_extracted_dir"
   _lowercase      :				str      					=       tmp_path / "custom_extracted_path"
   if default_extracted:
      _lowercase      :				Union[str, Any]      					=       ("downloads" if default_cache_dir else custom_cache_dir, "extracted")
   else:
      monkeypatch.setattr("datasets.config.EXTRACTED_DATASETS_DIR"		,							snake_case					)
      monkeypatch.setattr("datasets.config.EXTRACTED_DATASETS_PATH"		,							str(snake_case					)					)
      _lowercase      :				List[Any]      					=       custom_extracted_path.parts[-2:] if default_cache_dir else (custom_cache_dir, custom_extracted_dir)

   _lowercase      :				int      					=       xz_file
   _lowercase      :				str      					=       (
       DownloadConfig(extract_compressed_file=snake_case					)
       if default_cache_dir
       else DownloadConfig(cache_dir=tmp_path / custom_cache_dir		,							extract_compressed_file=snake_case					)
   )
   _lowercase      :				Optional[Any]      					=       cached_path(snake_case		,							download_config=snake_case					)
   assert Path(snake_case					).parent.parts[-2:] == expected







def  _A		(     snake_case					)      ->     Optional[Any]:
   # absolute path
   _lowercase      :				Dict      					=       str(Path(snake_case					).resolve()					)
   assert cached_path(snake_case					) == text_file
   # relative path
   _lowercase      :				Union[str, Any]      					=       str(Path(snake_case					).resolve().relative_to(Path(os.getcwd()					)					)					)
   assert cached_path(snake_case					) == text_file







def  _A		(     snake_case					)      ->     List[Any]:
   # absolute path
   _lowercase      :				Dict      					=       str(tmp_path.resolve() / "__missing_file__.txt"					)
   with pytest.raises(snake_case					):
      cached_path(snake_case					)
   # relative path
   _lowercase      :				List[Any]      					=       "./__missing_file__.txt"
   with pytest.raises(snake_case					):
      cached_path(snake_case					)







def  _A		(     snake_case					)      ->     Tuple:
   _lowercase      :				Union[str, Any]      					=       get_from_cache(F'''tmp://{tmpfs_file}'''					)
   with open(snake_case					) as f:
      _lowercase      :				Any      					=       f.read()
   assert output_file_content == FILE_CONTENT







@patch("datasets.config.HF_DATASETS_OFFLINE"		,							snake_case					)
def  _A		(     )      ->     int:
   with pytest.raises(snake_case					):
      cached_path("https://huggingface.co"					)







@patch("datasets.config.HF_DATASETS_OFFLINE"		,							snake_case					)
def  _A		(     snake_case					)      ->     str:
   _lowercase      :				Optional[Any]      					=       tmp_path_factory.mktemp("data"					) / "file.html"
   with pytest.raises(snake_case					):
      http_get("https://huggingface.co"		,							temp_file=snake_case					)
   with pytest.raises(snake_case					):
      http_head("https://huggingface.co"					)







@patch("datasets.config.HF_DATASETS_OFFLINE"		,							snake_case					)
def  _A		(     snake_case					)      ->     Any:
   _lowercase      :				Dict      					=       tmp_path_factory.mktemp("data"					) / "file.html"
   with pytest.raises(snake_case					):
      ftp_get("ftp://huggingface.co"		,							temp_file=snake_case					)
   with pytest.raises(snake_case					):
      ftp_head("ftp://huggingface.co"					)







@patch("datasets.config.HF_DATASETS_OFFLINE"		,							snake_case					)
def  _A		(     snake_case					)      ->     Optional[int]:
   _lowercase      :				List[str]      					=       tmp_path_factory.mktemp("data"					) / "file.html"
   with pytest.raises(snake_case					):
      fsspec_get("s3://huggingface.co"		,							temp_file=snake_case					)
   with pytest.raises(snake_case					):
      fsspec_head("s3://huggingface.co"					)









'''simple docstring'''
from math import sqrt







def  _A		(     snake_case					)      ->     int:
   _lowercase      :				str      					=       0
   for i in range(1		,							int(sqrt(snake_case					) + 1					)					):
      if n % i == 0 and i != sqrt(snake_case					):
         total += i + n // i
      elif i == sqrt(snake_case					):
         total += i
   return total - n







def  _A		(     snake_case = 1_00_00					)      ->     int:
   _lowercase      :				List[Any]      					=       sum(
       i
       for i in range(1		,							snake_case					)
       if sum_of_divisors(sum_of_divisors(snake_case					)					) == i and sum_of_divisors(snake_case					) != i					)
   return total


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






