
from __future__ import annotations

import math
from collections import Counter
from string import ascii_lowercase




def 							__SCREAMING_SNAKE_CASE   (		SCREAMING_SNAKE_CASE       :      str			)     ->						Optional[int]:
				__lowercase		,					__lowercase								=					analyze_text(_A			)
				__lowercase								=					list(' ' + ascii_lowercase			)
				# what is our total sum of probabilities.
				__lowercase								=					sum(single_char_strings.values()			)

				# one length string
				__lowercase								=					0
				# for each alpha we go in our dict and if it is in it we calculate entropy
				for ch in my_alphas:
								if ch in single_char_strings:
												__lowercase								=					single_char_strings[ch]
												__lowercase								=					my_str / all_sum
												my_fir_sum += prob * math.loga(_A			)  # entropy formula.

								# print entropy
				print(F"""{round(-1 * my_fir_sum			):.1f}"""			)

				# two len string
				__lowercase								=					sum(two_char_strings.values()			)
				__lowercase								=					0
				# for each alpha (two in size) calculate entropy.
				for cha in my_alphas:
								for cha in my_alphas:
												__lowercase								=					cha + cha
												if sequence in two_char_strings:
																__lowercase								=					two_char_strings[sequence]
																__lowercase								=					int(_A			) / all_sum
																my_sec_sum += prob * math.loga(_A			)

								# print second entropy
				print(F"""{round(-1 * my_sec_sum			):.1f}"""			)

				# print the difference between them
				print(F"""{round((-1 * my_sec_sum) - (-1 * my_fir_sum)			):.1f}"""			)




def 							__SCREAMING_SNAKE_CASE   (		SCREAMING_SNAKE_CASE       :      str			)     ->						int:
				__lowercase								=					Counter()  # type: ignore
				__lowercase								=					Counter()  # type: ignore
				single_char_strings[text[-1]] += 1

				# first case when we have space at start.
				two_char_strings[" " + text[0]] += 1
				for i in range(0    ,							len(_A			) - 1			):
								single_char_strings[text[i]] += 1
								two_char_strings[text[i : i + 2]] += 1
				return single_char_strings, two_char_strings




def 							__SCREAMING_SNAKE_CASE   (		)     ->						Union[str, Any]:
				import doctest

				doctest.testmod()
				# text = (
				#     "Had repulsive dashwoods suspicion sincerity but advantage now him. Remark "
				#     "easily garret nor nay. Civil those mrs enjoy shy fat merry. You greatest "
				#     "jointure saw horrible. He private he on be imagine suppose. Fertile "
				#     "beloved evident through no service elderly is. Blind there if every no so "
				#     "at. Own neglected you preferred way sincerity delivered his attempted. To "
				#     "of message cottage windows do besides against uncivil.  Delightful "
				#     "unreserved impossible few estimating men favourable see entreaties. She "
				#     "propriety immediate was improving. He or entrance humoured likewise "
				#     "moderate. Much nor game son say feel. Fat make met can must form into "
				#     "gate. Me we offending prevailed discovery. "
				# )

				# calculate_prob(text)


if __name__ == "__main__":
							main()








import os
import string
import sys


lowerCamelCase           =					1 << 8

lowerCamelCase           =					{
    '''tab''': ord('''\t'''),
    '''newline''': ord('''\r'''),
    '''esc''': 27,
    '''up''': 65 + ARROW_KEY_FLAG,
    '''down''': 66 + ARROW_KEY_FLAG,
    '''right''': 67 + ARROW_KEY_FLAG,
    '''left''': 68 + ARROW_KEY_FLAG,
    '''mod_int''': 91,
    '''undefined''': sys.maxsize,
    '''interrupt''': 3,
    '''insert''': 50,
    '''delete''': 51,
    '''pg_up''': 53,
    '''pg_down''': 54,
}

lowerCamelCase           =					KEYMAP['''up''']
lowerCamelCase           =					KEYMAP['''left''']

if sys.platform == "win32":
       lowerCamelCase           =					[]
       lowerCamelCase           =					{
           b'''\xe0H''': KEYMAP['''up'''] - ARROW_KEY_FLAG,
           b'''\x00H''': KEYMAP['''up'''] - ARROW_KEY_FLAG,
           b'''\xe0P''': KEYMAP['''down'''] - ARROW_KEY_FLAG,
           b'''\x00P''': KEYMAP['''down'''] - ARROW_KEY_FLAG,
           b'''\xe0M''': KEYMAP['''right'''] - ARROW_KEY_FLAG,
           b'''\x00M''': KEYMAP['''right'''] - ARROW_KEY_FLAG,
           b'''\xe0K''': KEYMAP['''left'''] - ARROW_KEY_FLAG,
           b'''\x00K''': KEYMAP['''left'''] - ARROW_KEY_FLAG,
       }

for i in range(10):
       lowerCamelCase           =					ord(str(i))




def 			UpperCAmelCase__				(			):





  '''simple docstring'''







  if os.name == "nt":
    import msvcrt

    a__  ='''mbcs'''
    # Flush the keyboard buffer
    while msvcrt.kbhit():
      msvcrt.getch()
    if len(_A							) == 0:
      # Read the keystroke
      a__  =msvcrt.getch()

      # If it is a prefix char, get second part
      if ch in (b"\x00", b"\xe0"):
        a__  =ch + msvcrt.getch()
        # Translate actual Win chars to bullet char types
        try:
          a__  =chr(WIN_KEYMAP[cha]							)
          WIN_CH_BUFFER.append(chr(KEYMAP['''mod_int''']							)							)
          WIN_CH_BUFFER.append(_A							)
          if ord(_A							) in (
              KEYMAP["insert"] - 1 << 9,
              KEYMAP["delete"] - 1 << 9,
              KEYMAP["pg_up"] - 1 << 9,
              KEYMAP["pg_down"] - 1 << 9,
          ):
            WIN_CH_BUFFER.append(chr(1_26							)							)
          a__  =chr(KEYMAP['''esc''']							)
        except KeyError:
          a__  =cha[1]
      else:
        a__  =ch.decode(_A							)
    else:
      a__  =WIN_CH_BUFFER.pop(0							)
  elif os.name == "posix":
    import termios
    import tty

    a__  =sys.stdin.fileno()
    a__  =termios.tcgetattr(_A							)
    try:
      tty.setraw(_A							)
      a__  =sys.stdin.read(1							)
    finally:
      termios.tcsetattr(_A	,      termios.TCSADRAIN	,      _A							)
  return ch




def 			UpperCAmelCase__				(			):





  '''simple docstring'''







  a__  =get_raw_chars()
  if ord(_A							) in [KEYMAP["interrupt"], KEYMAP["newline"]]:
    return char

  elif ord(_A							) == KEYMAP["esc"]:
    a__  =get_raw_chars()
    if ord(_A							) == KEYMAP["mod_int"]:
      a__  =get_raw_chars()
      if ord(_A							) >= KEYMAP["arrow_begin"] - ARROW_KEY_FLAG and ord(_A							) <= KEYMAP["arrow_end"] - ARROW_KEY_FLAG:
        return chr(ord(_A							) + ARROW_KEY_FLAG							)
      else:
        return KEYMAP["undefined"]
    else:
      return get_raw_chars()

  else:
    if char in string.printable:
      return char
    else:
      return KEYMAP["undefined"]
