#!/usr/bin/env python3
# -*- coding: utf-8 -*-


def main():
	n = int(input())
	s = input()
	ans1, ans2 = 0, 0
	ans1 = change1(n, list(s), ans1)
	ans2 = change2(n, list(s), ans2)
	print(min(ans1, ans2))

def change1(n, s, ans):
	for i in range(n-1):
		if s[i] == '#' and s[i+1] == '.':
			s[i] = '.'
			ans += 1
			return change1(n, s, ans)
	return ans

def change2(n, s, ans):
	for i in range(n-1):
		if s[i] == '#' and s[i+1] == '.':
			s[i+1] = '#'
			ans += 1
			return change2(n, s, ans)
	return ans
	


if __name__ == '__main__':
	import sys
	sys.exit(main())
