(PIX11) – A man is behind bars after barraging his ex-girlfriend with 21,807 texts and phone calls.

The 33-year-old from France — who now has to serve at least four months of a 10-month sentence — admitted that “it was stupid,” according to The Guardian.

The man, who hasn’t been named, was demanding either payment or a ‘thank you’ for the work he had done on her apartment while he was living there.

“At the time, my logic was that until she returns the money . . . or at least says thank you, I would not stop the calls,” he explained in a Lyon courtroom. He fired off an average of 73 calls or texts per day over 10 months — even targeting her parents and workplace when she blocked her line, according to the 32-year-old victim’s lawyer, Manuella Spee.

The woman finally did thank him for the home improvement in a meeting set up by a mediator, and he stopped harassing her.

The former couple, from Rhone, in southern France, broke up in 2011 after the victim decided to end the relationship.

The defendant, who has a history of depression, has been ordered to undergo a psychological evaluation and pay almost $13,000 in fines.