Recently, there have been many attempts to develop a mathematical model that captures the nature of crime. One of the successful models has been based on diffusion-type differential equations that describe how criminals spread in a specific area. Here, we propose a dynamic model that focuses on the effect of interactions between distinct types of criminals. The accumulated criminal records show that serious and minor crimes differ in many measures and are related in a complex way. While some of those who have committed minor crime spontaneously evolve into serious criminals, the transition from minor crime to major crime involves many social factors and has not been fully understood yet. In this work, we present a mathematical model to describe how minor criminals turn into major criminals inside and outside of prisons. The model assumes that a population can be divided into a set of compartments, according to the level of crime and whether arrested or not, and individuals have equal probability to change compartment. The model is design to implement two social effects which respectively have been conceptualized in popular terms "broken windows effect" and "prison as a crime school." Analysis of the system shows how the crime-related parameters such as the arrest rate, the period of imprisonment, and the in-prison contact rate affect the criminal distribution at equilibrium. Without proper control of contact between prisoners, the longer imprisonment rather increases occurrence of serious crimes in society. An optimal allocation of the police resources to suppress crimes is also discussed.