import re

sentences = ["'Teacher who was jailed after classroom row over transgender pupil and refusing to 'call a boy a girl' will be joined in prison by his father after courtroom scuffle",
			 "Did you see Cress' haircut?.",
			 "This 'thing' hasn't a really bad habit, you know?.",
			 "'I bought this for $30 from Best Buy it's. What a waste of money! The ear gels are 'comfortable at first, but what's after an hour."]
			 
for s in sentences:
	# Remove the specified characters
	# new_s = len(re.findall(r"""'(?!(?<! ')[ts])""", s))
	new_s = len(re.findall(r"""'[(?<!s)]'|'(?!(?<! ')[tsmlvr])""", s))
	
	# Deal with the final dot
	print(new_s)
