5.  The applicant was born in 1990 and lived in Moscow until his arrest. 6.  The background facts relating to the planning, conduct and dispersal of the demonstration at Bolotnaya Square are set out in more detail in Frumkin v. Russia (no. 74568/12, §§ 7-65, 5 January 2016), and Yaroslav Belousov v. Russia (nos. 2653/13 and 60980/14, §§ 7-33, 4 October 2016). The parties’ submissions on the circumstances directly relevant to the present case are set out below. 7.  On 6 May 2012 a public demonstration entitled the “March of Millions” was held in central Moscow to protest against the allegedly rigged presidential elections. The event had been approved by the city authorities in the form of a march followed by a meeting at Bolotnaya Square, which was supposed to end at 7.30 p.m. The march was peaceful and held without any disruptions, but when the marchers arrived at Bolotnaya Square it became apparent that barriers installed by the police had narrowed the entrance to the meeting venue, allegedly restricting the space allocated for the meeting. To control the crowd the police cordon forced the protestors to remain within the barriers; there were numerous clashes between the two sides. At 5.30 p.m. the police ordered the meeting to finish early and began to disperse the participants. It took them about two hours to clear the square. 8.  On the same day the Moscow city department of the Investigative Committee of the Russian Federation opened criminal proceedings to investigate suspected acts of mass disorder and violence against the police (Articles 212 § 2 and 318 § 1 of the Criminal Code). On 18 May 2012 the file was transferred to the headquarters of the Investigative Committee for further investigation. On 28 May 2012 an investigation was also launched into the criminal offence of organising acts of mass disorder (Article 212 § 1 of the Criminal Code). The two criminal cases were joined on the same day. 9.  At the time of his arrest the applicant was a second-year student at the Moscow University of Social Studies and worked part-time as a courier for an insurance company. According to him, on 6 May 2012 he arrived at Kaluzhskaya Square to take part in the march and walked with other participants to Bolotnaya Square. Upon arrival there he discovered that the police cordon had blocked access to the square. When passage to the stage of the rally taking place along the embankment was opened, the applicant went in that direction. The police started to disperse the protesters, using excessive force and beating them with truncheons. In response, the protesters dragged metal barriers in place to protect themselves from the police. At one point the applicant observed a protester in a green T-shirt, who five or six police officers were holding and beating with truncheons. He grabbed the protester and pulled him back, trying to protect him from the blows. The applicant was later arrested by the police and taken to a police station before being released shortly after. After the events in question he continued to live at his usual address and pursue his studies. 10.  On 26 July 2012 the applicant was arrested on suspicion of having participated in acts of mass disorder on 6 May 2012. 11.  On 27 July 2012 the Basmannyy District Court ordered that the applicant be placed in pre-trial detention until 26 September 2012. It referred to the gravity of the charges and information about the applicant’s character, including a report by Moscow Police’s chief of department at the Centre for Counter-Extremism. According to that report, the applicant was an active member of organisations of a destructive character. If he were to stay at liberty, he planned to threaten witnesses, abscond and obstruct the investigation. The court concluded that those circumstances gave sufficient grounds to believe that the applicant was likely to flee to avoid the investigation and trial, destroy evidence or otherwise obstruct the investigation of the criminal case, which was still at an initial stage. 12.  On 1 August 2012 charges were brought against the applicant under Article 212 § 2 (participation in acts of mass disorder accompanied by violence). He was accused, in particular, of resisting police officers by pushing them away when they were arresting other protestors and by trying to liberate the latter. 13.  On 27 August 2012 the Moscow City Court upheld the detention order of 27 July 2012. 14.  On 24 September 2012 the Basmannyy District Court examined an application from the investigator for an extension of the applicant’s pre-trial detention. The applicant asked for the preventive measure to be changed to house arrest, a written undertaking not to leave a specified place, bail or personal guarantees. On the same day the District Court granted the investigator’s application and extended the applicant’s detention until 6 November 2012. It considered that the circumstances justifying the detention order had not changed. 15.  On 1 October 2012 Police Officer T. identified the applicant during an identification parade as a participant in mass disorder who had used violence against him. In particular, when T. and other officers had been arresting a protester, the applicant had grabbed his hand and pulled it off the protestor, thereby causing the police officer pain. Another police officer, L., also identified the applicant as a participant in acts of mass disorder who had tried to prevent the police arresting another protestor. 16.  On 22 October 2012 the Moscow City Court dismissed the applicant’s appeal against the extension order of 24 September 2012. 17.  On 29 October 2012 the Basmannyy District Court granted an extension of the applicant’s detention until 6 March 2013, essentially on the same grounds as earlier, noting that the circumstances justifying the detention order had not changed. In particular, it dismissed an objection from the applicant to the use of the operational-search reports concerning his character and rejected his contesting of the alleged membership of any organisations of a destructive nature. 18.  On 15 November and 21 December 2012 the charges against the applicant were reformulated. It was stated that the applicant, who had been wearing a surgical mask to conceal his face, had used violence against the police while trying to liberate protestors who had been arrested and that he had pushed police officers away. In particular, he had grabbed Officer T.’s hand and pulled it off a protester, thereby preventing his arrest. He had also built a line of metal barriers to block the police and had tried to repel the police with them. The applicant’s alleged offences were classified additionally under Article 318 § 1 of the Criminal Code (use of violence against a public official). 19.  On 5 March 2013 the Basmannyy District Court granted a new extension of the applicant’s detention, until 6 July 2013, essentially on the same grounds as before. On 17 April 2013 the Moscow City Court upheld the extension order. 20.  On 24 May 2013 the applicant’s criminal case was transferred to the Zamoskvoretskiy District Court of Moscow for the determination of criminal charges. 21.  On 6 June 2013 that court granted another extension of the applicant’s detention, until 24 November 2013. The decision concerned eleven defendants. Along with the gravity of the charges, the court based its decision on the findings that “the reasons which initially warranted the detention have not changed” and that “no other measures of restraint would secure the aims and goals of the judicial proceedings”. The applicant’s request for an alternative preventive measure was dismissed on the grounds that no other measure could secure the proper course of justice in the case. The Moscow City Court upheld the extension order on 2 July 2013. 22.  On 19 November 2013 the Zamoskvoretskiy District Court granted another extension of detention in respect of nine defendants, including the applicant. It ordered their detention until 24 February 2014 on the grounds of the gravity of the charges and the nature of the offences imputable to them. On 17 December 2013 the Moscow City Court upheld that extension order. 23.  The applicant was held in IZ-77/2 for the whole period of his pre-trial detention from 4 September 2012. According to him, the conditions of his detention had been poor. The applicant referred to cases against Russia in which the Court had previously found a breach of Article 3 because of overcrowding in IZ-77/2 in 2004-2005 (see Lind v. Russia, no. 25664/05, §§ 42 and 58-63, 6 December 2007; Zentsov and Others v. Russia, no. 35297/05, §§ 25-29 and 40-44, 23 October 2012; and Vyatkin v. Russia, no. 18813/06, §§ 26‑27 and 38-43, 11 April 2013). The applicant submitted that his conditions of detention had been similar. 24.  The applicant’s description of the conditions of detention during his transfer from the remand prison to court and back and the Government’s submissions in that regard were identical to those in the case of Yaroslav Belousov (cited above, §§ 69-73). 25.  As regards the conditions of detention in the convoy room of the Moscow City Court, the applicant submitted that it was poorly lit and that access to the toilet was limited to once an hour. In addition, he had been required to strip naked and to perform sit-ups during the body search conducted in the convoy room. 26.  On 6 June 2013 court proceedings began in hearing room no. 338 at the Moscow City Court, moving at the end of July 2013 to hearing room no. 635. The defendants, including the applicant, were held in glass cabins in both hearing rooms. From mid-September 2013 to the end of 2013 the hearings continued at the Nikulinskiy District Court of Moscow in hearing room no. 303, while in January and February 2014 they took place at the Zamoskvoretskiy District Court in hearing room no. 410. Those hearing rooms were equipped with metal cages in which nine defendants (seven from 19 December 2013), including the applicant, sat during the hearings. 27.  For a detailed description of the conditions in those hearing rooms see Yaroslav Belousov (cited above, §§ 74-77). 28.  On 6 June 2013 the Zamoskvoretskiy District Court of Moscow began a preliminary hearing in a criminal case against ten participants in the demonstration at Bolotnaya Square, who were charged with participation in acts of mass disorder and committing acts of violence against police officers. On 18 June 2013 the same court began the trial on the merits. 29.  On 5 September 2013 Police Officer T., the alleged victim of the applicant’s assault, was examined as a witness. He testified that the applicant had impeded him and two other police officers from arresting a protester by grabbing T.’s hand and pushing the officers away. The applicant had caused him pain but had not inflicted any injuries. During the hearing the applicant and his lawyers applied to deprive T. of victim status because no harm had been caused to him, but the court refused that request as unsubstantiated. 30.  On 21 February 2014 the Zamoskvoretsky District Court of Moscow found the applicant guilty as charged. It held, in particular, as follows:
“Between 4 p.m. and 8 p.m. on 6 May 2012 ... at Bolotnaya Square ... unidentified persons ... called those present [at the venue] to move outside the agreed meeting venue, to defy the lawful orders of the police ..., to use violence ... which led to mass disorder accompanied by the use of violence against public officials in connection with the performance of their duties [and] the destruction of property.
On the same day at 5 p.m. at the latest [the defendants] acquired the criminal intent to participate in mass disorder and to use violence against ... police officers ...
Moreover ... the participants of the acts of mass disorder threw chunks of tarmac, stones, sticks and other objects at the police ... which hit them on various parts of their body, and [the defendants] ... [who] participated in the acts of mass disorder ... implemented their criminal intent to use violence against public officials ... applied physical force which was not a danger to the life or health of those [officials] ...
[The applicant] ... who was wearing a surgical mask to hide his face, together with unidentified persons ... tried to liberate those arrested by the police for a breach of public order and pushed the police officers away ...
... [the applicant] used violence against Police Officer [T.] which did not endanger his life or health ...
[The applicant] ... from 5 p.m. to 9.40 p.m. ... when unidentified participants of acts of mass disorder tried to break the police cordon, acting intentionally and using force, grabbed [T.’s] hand and then pulled it off the person whom [T.] was arresting, thus impeding his apprehension, which caused [T.] pain.
In addition, [the applicant] together with unidentified persons ... built a line of metal barriers blocking the police’s movements, and ... tried to repel the line of police officers ... with the help of those barriers.
[The applicant] pleaded not guilty and testified that ... he had decided to attend the public gathering on 6 May 2012 ... for the purposes of personal security he wore a surgical mask ... [The applicant] was at the bridge when a blockage occurred. He did not see what was happening, but at one point ... he had been able to proceed with the flow of people towards the stage. There [the applicant] saw the mass beating of people by police officers and participants of the rally starting to bring forward metal barriers ... and to put them close to the police officers, trying to protect themselves from the latter. [The applicant] was standing close to the barriers, taking his hands off when the police officers used their truncheons to hit over the barriers. Then ... [the applicant] saw a group of five or six police officers who were trying to seize a young man in a green T-shirt. They hit the man with their truncheons, and [the applicant], considering that the man was in danger because the police actions were unlawful, tried to snatch him from the officers’ hands. He grasped the young man’s waistband, pulled it and turned his back to protect him from the truncheon blows. [The applicant] finds it conceivable that in this turmoil he might unintentionally have pushed someone and asks for attention to be paid to [T.’s] statements that the latter did not feel any pain. Then [the applicant] was arrested and taken to a police vehicle.
... the court considers the [defendants’] arguments that they were protecting somebody from police officers or happened to be victims of the police’s use of force as farfetched and aimed at the mitigation of their responsibility ...” 31.  The applicant was sentenced to three years and six months’ imprisonment, calculated on the basis of a three-year prison term under Article  212 § 2 of the Criminal Code, partly concurrent with a term of one year and three months under Article 318 § 1. The applicant’s pre-trial detention counted towards the prison sentence. 32.  The applicant appealed. He complained that the same acts imputed to him had been classified under both Article 212 and Article 318 of the Criminal Code. He insisted that he had not used violence against T. because the latter had not suffered any pain or injuries. 33.  On 20 June 2014 the Moscow City Court upheld the first-instance judgment.