On a South American adventure, Alec Webb found himself in a prison cell

Gap-year travellers Shanti Andrews and Rebecca Turner are awaiting the outcome of their appeal against a sentence of 16 months' community service after pleading guilty to making a false insurance claim in Brazil. Their story reminds me of my own gap-year brush with the Brazilian police which concluded with a short and not very enjoyable spell in a Sao Paulo jail.

Three friends and I were travelling through Latin America and had reached Sao Paulo when one friend became romantically involved with a Brazilian woman during a night out. In the early hours, our friend returned to our hotel and was told by the receptionist that guests were prohibited from bringing unregistered visitors to the hotel.

Love proved more powerful than the receptionist's warning and the pair sprinted up the stairs and into the bedroom while the irate receptionist proceeded to call the police.

The first I knew of this event was when another travelling partner and I were interrupted midbreakfast by a large squad of gun-toting policemen who marched us into our room to retrieve our passports. Next stop, the local police station where all involved were left in the waiting room as our captors discussed our apparently trivial crime.

Our hearts sank when we spotted our friend's new companion trying to push a packet of cocaine into the coin slot of a phone box. They sank even further, when the males among our party were led into a room and asked to undress for a "routine" strip-search.

We proved (at some cost to our pride) that we were drug free. The police searched the woman who, despite her earlier efforts, was found in possession of a quantity of cocaine.

We were escorted to a cell. Any attempt to sleep was foiled by the chill of the concrete floor and the regular appearance of police to tell us that we would be there for a long time. After several hours, they brought someone to join us – a local drug addict who began taking out his aggression on the cell walls. We decided the best strategy was to make friends. Due to the language barrier, and given that our only common ground was incarceration, we took it in turns to mime possible methods of escape. His contribution had echoes of The Shawshank Redemption.

During our day of incarceration, we received no food or water. Thankfully, after 12 hours of taunting, the police informed us that the woman had written a statement which confirmed we had not been involved in any drug taking and that the relationship between our friend and herself was genuine and had not involved the exchange of money.

Clearly we were lucky, and although we were on the right side of the law, our devil-may-care attitude to new and potentially dangerous places could have landed us in a similarly dire situation to that of Shanti and Rebecca. I can't help but feel some sympathy for the pair, particularly as before being granted bail, they spent a week in Rio's notorious female prison, Polinter de Mesquita.

Their seemingly harsh sentence was no doubt intended as a warning to the estimated 200,000 people aged 18 to 25 who will set off on a gap year this autumn.

Some may be tempted to try to recoup some of the thousands of pounds spent on the average gap year by making a false claim on travel insurance. While some might might think this a relatively minor crime, merely pilfering money from a vast, faceless multinational, it can have huge ramifications.

Backpackers are distorting crime figures, making the country in which they choose to perpetrate the fraud seem like a less attractive holiday destination.

Irony aside, Shanti's father provides a good insight into the unfairness of falsely skewing a country's crimes statistics: "Of all the countries on their list, I particularly didn't want them to go to Brazil. I'd read so much about the crime and corruption." This is particularly pertinent in the case of Brazil, where tourism provides one in every 17 jobs.

Nevertheless, the current Foreign Office advice shows there is a high risk of a real theft taking place: "Dress down, avoid wearing jewellery and expensive watches, and only carry small sums of money. Conceal mobile phones and cameras ... be ready to hand over your valuables if threatened."

Oh, and be careful about who you make friends with.