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


def main():
	n = int(input())
	s = input()
	ans = 0
	ans = change(n, s, ans)
	print(ans)

def change(n, s, count):

	tmp = list(s)
	for i in range(n-1):
		if s[i] == '#' and s[i+1] == '.':
			tmp[i] = '.'
			count += 1
	"".join(tmp)
	if tmp != s:
		change(n, tmp, count)

	return count

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