Background: Ronnie and Reggie Kray were born on 24 October 1933 in Hoxton, East London, to Charles David Kray (10 March 1907 - 8 March 1983), a scrap gold dealer, and Violet Annie Lee (5 August 1909 - 4 August 1982). They were of English, Jewish, Irish and Romani Gypsy heritage. The brothers were identical twins, with Reggie being born ten minutes before Ronnie. Their parents already had a six-year-old son, Charles James (9 July 1927 - 4 April 2000).
Context: The Kray twins were notorious for their gang and its violence, and narrowly avoided being sent to prison many times. Young men were conscripted for national service at this time, and the twins were called up to serve with the Royal Fusiliers in 1952. They reported, but attempted to leave after only a few minutes. The corporal in charge tried to stop them, but Ronnie punched him on the chin, leaving him seriously injured; the Krays walked back to the East End. They were arrested the next morning and were turned over to the army. While absent without leave, they assaulted a police constable who tried to arrest them. They were among the last prisoners held at the Tower of London before being transferred to Shepton Mallet military prison in Somerset for a month to await court-martial. They were convicted and sent to the Buffs' Home Counties Brigade Depot jail in Canterbury, Kent. Their behaviour in prison was so bad that they both received dishonourable discharges from the army. They tried to dominate the exercise area outside their one-man cells during their few weeks in prison, when their conviction was certain. They threw tantrums, emptied their latrine bucket over a sergeant, dumped a dixie (a large food and liquid container) full of hot tea on another guard, handcuffed a guard to their prison bars with a pair of stolen cuffs and set their bedding on fire. They were moved to a communal cell where they assaulted their guard with a china vase and escaped. They were quickly recaptured and awaited transfer to civilian authority for crimes committed while at large; they spent their last night in Canterbury drinking cider, eating crisps and smoking cigarillos courtesy of the young national servicemen acting as their guards.
Question: how long were they in the prison in somerset?

Answer:
a month to await court-martial.