f=input; from bisect import bisect_left as g, insort as h
f(); s,i=list(f()),0
from collections import *
d=defaultdict(list)
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 f() f s,i=list(f()),0 s list(f()) list f() f i 0 from collections import * d=defaultdict(list) d defaultdict(list) defaultdict list 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 d=defaultdict(list) defaultdict(list) d i=list(f()),0 0 i b,c=f().split() f().split() b f=input input f c=f().split() f().split() c b=int(b)-1 int(b)-1 b a,b,c=f().split() f().split() a s,i=list(f()),0 list(f()) s
f=input; from bisect import bisect_left as g, insort as h
f(); s,i=list(f()),0
from collections import *
d=defaultdict(list)
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)