output_description: Print the number of different strings you can obtain by reversing any
  substring in A at most once.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      A
attempt: A = input()
  ans = 0
  a = A.count("a")
  b = A.count("b")
  c = A.count("c")
  d = A.count("d")
  e = A.count("e")
  f = A.count("f")
  g = A.count("g")
  h = A.count("h")
  i = A.count("i")
  j = A.count("j")
  k = A.count("k")
  l = A.count("l")
  m = A.count("m")
  n = A.count("n")
  o = A.count("o")
  p = A.count("p")
  q = A.count("q")
  r = A.count("r")
  s = A.count("s")
  t = A.count("t")
  u = A.count("u")
  v = A.count("v")
  w = A.count("w")
  x = A.count("x")
  y = A.count("y")
  z = A.count("z")
  B = [a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z]
  for aa in range(26):
      ans = ans + B[aa] * (len(A) - B[aa])
  print(ans)
  
problem_description: Statement
  
  You have a string A = A_1 A_2 ... A_n consisting of lowercase English letters.
  
  You can choose any two indices i and j such that 1 \leq i \leq j \leq n and
  reverse substring A_i A_{i+1} ... A_j.
  
  You can perform this operation at most once.
  
  How many different strings can you obtain?
samples: [{"input": "aatt", "output": "5\n    \n\nYou can obtain `aatt` (don't do anything), `atat` (reverse A[2..3]), `atta`\n(reverse A[2..4]), `ttaa` (reverse A[1..4]) and `taat` (reverse A[1..3]).\n\n* * *"}, {"input": "xxxxxxxxxx", "output": "1\n    \n\nWhatever substring you reverse, you'll always get `xxxxxxxxxx`.\n\n* * *"}, {"input": "abracadabra", "output": "44"}]