N = int(input())
S = input()

# '#': black, '.': white

prev = None
current = None

fix_place = []

for index, current in enumerate(S):
  if prev == '#' and current == '.': # left: black, current: white
    fix_place.append(index)
  prev = current
    
print(len(fix_place))
    
  
    