f=input; from bisect import bisect_left as g, insort as h
d={chr(97+i):[] for i in range(26)}
f(); s,i=list(f()),0
for c in s: d[c]+=[i]; i+=1
for _ in range(int(f())):
  a,b,c=f().split(); b=int(b)-1
  if a>'1': print(sum(1 for l in d.values() if g(l,b)<len(l) and l[g(l,b)]<int(c)))
  elif s[b]!=c: l=d[s[b]]; l.pop(g(l,b)); s[b]=c; h(d[c],b) f=input f input from bisect import bisect_left as g, insort as h chr(97+i):[] for i in range(26) for i in range(26) i range(26) range 26 for i in range(26) chr(97+i) chr 97+i 97 i [] d={chr(97+i):[] for i in range(26)} d {chr(97+i):[] for i in range(26)} f() f s,i=list(f()),0 s list(f()) list f() f i 0 for c in s: d[c]+=[i]; i+=1 c s for _ in range(int(f())):
  a,b,c=f().split(); b=int(b)-1
  if a>'1': print(sum(1 for l in d.values() if g(l,b)<len(l) and l[g(l,b)]<int(c)))
  elif s[b]!=c: l=d[s[b]]; l.pop(g(l,b)); s[b]=c; h(d[c],b) _ range(int(f())) range int(f()) int f() f a,b,c=f().split() a f().split() ().split () f split b c b=int(b)-1 b int(b)-1 int(b) int b 1 if a>'1': print(sum(1 for l in d.values() if g(l,b)<len(l) and l[g(l,b)]<int(c)))
  elif s[b]!=c: l=d[s[b]]; l.pop(g(l,b)); s[b]=c; h(d[c],b) a>'1' a '1' elif s[b]!=c: l=d[s[b]]; l.pop(g(l,b)); s[b]=c; h(d[c],b) s[b]!=c s[b] s b c a,b,c=f().split() f().split() a c=f().split() f().split() c i=list(f()),0 0 i s,i=list(f()),0 list(f()) s f=input input f b,c=f().split() f().split() b d={chr(97+i):[] for i in range(26)} {chr(97+i):[] for i in range(26)} d b=int(b)-1 int(b)-1 b
f=input; from bisect import bisect_left as g, insort as h
d={chr(97+i):[] for i in range(26)}
f(); s,i=list(f()),0
for c in s: d[c]+=[i]; i+=1
for _ in range(int(f())):
  a,b,c=f().split(); b=int(b)-1
  if a>'1': print(sum(1 for l in d.values() if g(l,b)<len(l) and l[g(l,b)]<int(c)))
  elif s[b]!=c: l=d[s[b]]; l.pop(g(l,b)); s[b]=c; h(d[c],b)