output_description: Print the value of \displaystyle{\sum_{a=1}^{K}\sum_{b=1}^{K}\sum_{c=1}^{K}
  \gcd(a,b,c)}.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      K
attempt: [
      print(
          sum(
              [
                  g(g(i, j), k)
                  for g in [__import__("math").gcd]
                  for n in [int(input())]
                  for r in [range(1, n + 1)]
                  for i in r
                  for j in r
                  for k in r
              ]
          )
      )
  ]
  
problem_description: Statement
  
  Find \displaystyle{\sum_{a=1}^{K}\sum_{b=1}^{K}\sum_{c=1}^{K} \gcd(a,b,c)}.
  
  Here \gcd(a,b,c) denotes the greatest common divisor of a, b, and c.
samples: [{"input": "2", "output": "9\n    \n\n\\gcd(1,1,1)+\\gcd(1,1,2)+\\gcd(1,2,1)+\\gcd(1,2,2)\n+\\gcd(2,1,1)+\\gcd(2,1,2)+\\gcd(2,2,1)+\\gcd(2,2,2) =1+1+1+1+1+1+1+2=9\n\nThus, the answer is 9.\n\n* * *"}, {"input": "200", "output": "10813692"}]