output_description: Print the answer.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      N
attempt: class SegmentTree:
      def __init__(self, orig, func, unit):
          _len = len(orig)
          self.func = func
          self.size = 1 << (_len - 1).bit_length()
          self.tree = [unit] * self.size + orig + [unit] * (self.size - _len)
          self.unit = unit
  
          for i in range(self.size - 1, 0, -1):
              self.tree[i] = func(self.tree[i * 2], self.tree[i * 2 + 1])
  
      def update(self, i, v):
          i += self.size
          self.tree[i] = v
          while i:
              i //= 2
              self.tree[i] = self.func(self.tree[i * 2], self.tree[i * 2 + 1])
  
      def find(self, l, r):
          l += self.size
          r += self.size
          ret = self.unit
          while l < r:
              if l & 1:
                  ret = self.func(ret, self.tree[l])
                  l += 1
              if r & 1:
                  r -= 1
                  ret = self.func(ret, self.tree[r])
              l //= 2
              r //= 2
          return ret
  
  
  import sys
  
  input = sys.stdin.readline
  from operator import or_
  
  input()
  seg = SegmentTree([1 << ord(x) - 97 for x in input()[:-1]], or_, 0)
  ans = []
  for _ in range(int(input())):
      f, x, y = input().split()
      if f == "1":
          seg.update(int(x) - 1, 1 << ord(y) - 97)
      else:
          ans.append(bin(seg.find(int(x) - 1, int(y))).count("1"))
  print(*ans)
  
problem_description: Statement
  
  Takahashi wants to print a document with N pages double-sided, where two pages
  of data can be printed on one sheet of paper.
  
  At least how many sheets of paper does he need?
samples: [{"input": "5", "output": "3\n    \n\nBy printing the 1-st, 2-nd pages on the 1-st sheet, 3-rd and 4-th pages on the\n2-nd sheet, and 5-th page on the 3-rd sheet, we can print all the data on 3\nsheets of paper.\n\n* * *"}, {"input": "2", "output": "1\n    \n\n* * *"}, {"input": "100", "output": "50"}]