# How many urinals are free?
In men's public toilets with urinals, there is this unwritten rule that you leave at least one urinal free
between you and the next person peeing. 
For example if there are 3 urinals and one person is already peeing in the left one, you will choose the
urinal on the right and not the one in the middle.
That means that a maximum of 3 people can pee at the same time on public toilets with 
5 urinals when following this rule (Only 2 if the first person pees into urinal 2 or 4).

![Imgur Urinals](https://i.imgur.com/imZE6xm.png)

## Your task:
You need to write a function that returns the maximum of free urinals as an integer according to the unwritten rule.

### Input
A String containing 1s and 0s (Example: `10001`) (1 <= Length <= 20)  
A one stands for a taken urinal and a zero for a free one. 

### Examples

`10001` returns 1 (10101)  
`1001` returns 0 (1001)  
`00000` returns 3 (10101)  
`0000` returns 2 (1001)  
`01000` returns 1 (01010 or 01001) 

### Note
When there is already a mistake in the input string (for example `011`), then return `-1`

Have fun and don't pee into the wrong urinal ;)

Source: codewars | Difficulty: EASY
Tags: Fundamentals

Starter code: def get_free_urinals(urinals):
	

Solutions:
def get_free_urinals(urinals):
	return -1 if '11' in urinals else sum(((len(l) - 1) // 2 for l in f'0{urinals}0'.split('1')))


def get_free_urinals(urinals):
	if '11' in urinals:
		return -1
	if urinals == '0':
		return 1
	free = 0
	i = 0
	while i < len(urinals):
		if i == 0 and urinals[i:i + 2] == '00' or (i > 0 and urinals[i - 1:i + 2] == '000') or (i == len(urinals) - 1 and urinals[i - 1:] == '00'):
			free += 1
			i += 2
		else:
			i += 1
	return free


def get_free_urinals(urinals):
	if urinals.count('11'):
		return -1
	return urinals.replace('10', '1').replace('01', '1').replace('00', '0').count('0')


def get_free_urinals(urinals):
	if '11' in urinals:
		return -1
	us = list(map(int, urinals + '00'))
	free = 0
	for i in range(len(urinals)):
		if us[i] == 0 == us[i - 1] == us[i + 1]:
			us[i] = 1
			free += 1
	return free


import re

def get_free_urinals(urinals):
	if '11' in urinals:
		return -1
	return sum(((len(g) + 1) // 2 for g in re.split('0?1+0?', urinals)))


def get_free_urinals(urinals):
	if '11' in urinals:
		return -1
	return sum(((len(s) - 1) // 2 for s in f'10{urinals}01'.split('1') if s))


import re

def get_free_urinals(urinals):
	return -1 if '11' in urinals else sum(((1 + len(sub)) // 2 for sub in re.split('0?10?', urinals)))


def get_free_urinals(urinals):
	return -1 if '11' in urinals else sum((len(x) - 1 >> 1 for x in f'0{urinals}0'.split('1')))


def get_free_urinals(urinals):
	count = 0
	urinals = list(urinals)
	for i in range(len(urinals)):
		if urinals[i] == '1' and i + 1 != len(urinals) and (urinals[i + 1] == '1'):
			return -1
		if urinals[i] == '0' and (i == 0 or urinals[i - 1] == '0') and (i + 1 == len(urinals) or urinals[i + 1] == '0'):
			urinals[i] = '2'
	return urinals.count('2')


import re

def get_free_urinals(u):
	return -1 if '11' in u else len(re.findall('(?<!1)0[0$]?(?!1)', u))