# -*- coding: utf-8 -*-
import sys
import copy
import collections
from bisect import bisect_left
	
def main():
	N = int(input())
	S = input()
	
	kuro = []
	for i, val in enumerate(S):
		if i == 0:
			if val == "#":
				kuro.append(1)
			else:
				kuro.append(0)
			continue
		if val == "#":
			kuro.append(kuro[i-1] + 1)
		else:
			kuro.append(kuro[i-1])
	
	shiro = [0 for _ in range(N)]
	for i in range(N-1, -1, -1):
		if i == N-1:
			if S[i] == ".":
				shiro[i] = 1
			else:
				shiro[i] = 0
			continue
		if S[i] == ".":
			shiro[i] = shiro[i+1] + 1
		else:
			shiro[i] = shiro[i+1]
			
	ans = 1000000000000000
	for i in range(N):
		tmp = -1
		if i == 0:
			tmp = shiro[0]
		elif i == N-1:
			tmp = kuro[N-1]
		else:
			tmp = kuro[i] + shiro[i+1]
		if ans > tmp:
			ans = tmp
	
	#print(kuro)
	#print(shiro)
	print(ans)
	
	
if __name__ == "__main__":
	main()
