output_description: Print `YES` if this grid remains the same when rotated 180 degrees; print `NO`
  otherwise.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      C_{11}C_{12}C_{13}
      C_{21}C_{22}C_{23}
attempt: 
  # index が条件をみたかどうか
  def isLess(index, key, a):
  	if a[index] >= key:
  		return True
  	else: 
  		return False
        
  def isUpper(index, key, a):
  	if a[index] > key:
  		return True
  	else: 
  		return False
        
  def binary_search(key, a, upper=True):
      left = -1 # index = 0 が条件を満たすこともあるので初期値は−１
      right= len(a) # index = len(a) -1 が条件満たさないこともある
   
      # どんな二分探索でもここの書き方を変えずにできる
      while right - left > 1 :
          mid = left + ((right - left + 1) // 2)
          if upper:
              if isUpper(mid, key, a): # isOKの名前でこの関数内の条件判定変えれば色々できそう
                  right = mid
              else:
                  left = mid
          else:
              if isLess(mid, key, a): # isOKの名前でこの関数内の条件判定変えれば色々できそう
                  right = mid
              else:
                  left = mid
      return right
  
  import sys
  
  def main():
      n = int(input())
      a_l = sorted(list(map(int, sys.stdin.readline().strip().split()))
      b_l = sorted(list(map(int, sys.stdin.readline().strip().split()))
      c_l = sorted(list(map(int, sys.stdin.readline().strip().split()))
      cnt = 0
      for b in b_l:
          a_under_b_idx = binary_search(b, a_l, upper=False)
          c_upper_b_idx = binary_search(b, c_l)
          cnt += len(a_l[:a_under_b_idx])*len(c_l[c_upper_b_idx:])
      print(cnt)
      
      
  if __name__ == '__main__':
      main()
problem_description: Statement
  
  You are given a grid with 2 rows and 3 columns of squares. The color of the
  square at the i-th row and j-th column is represented by the character C_{ij}.
  
  Write a program that prints `YES` if this grid remains the same when rotated
  180 degrees, and prints `NO` otherwise.
samples: [{"input": "pot\n    top", "output": "YES\n    \n\nThis grid remains the same when rotated 180 degrees.\n\n* * *"}, {"input": "tab\n    bet", "output": "NO\n    \n\nThis grid does not remain the same when rotated 180 degrees.\n\n* * *"}, {"input": "eye\n    eel", "output": "NO"}]