This question already has an answer here:
I am an American who studied at a Latvian university in the previous fall semester. I had planned to stay almost an academic year, so the company that organized my trip and partnered with the university in Latvia told me that I needn't worry about the 90 day limit, that they would register me for a temporary residence permit so that I could stay in Latvia longer than 90 days. Despite the fact that I gave them all the documentation they requested for this, they apparently forgot to do it. Anyway, I left Latvia to spend time in Moscow during the winter holiday and, naturally, was denied re-entry on the basis that I had already significantly overstayed. I wasn't fined at the Latvian border. The border guard simply told me I would be able to return if I stayed away for 90 days, no penalty, just a warning and a document explaining the 90/180 day rule.
I currently have tickets to fly back to America on May 3rd from Moscow to Riga and then Frankfurt. I entered Schengen August 28th and left for Russia January 12th. I was denied re-entry February 7th. Does the entry refusal affect the 180 day period in some way? Am I at risk of a fine for the overstay if someone notices in, say, Frankfurt?