In this paper, we present a novel convolutional neural network (CNN) architecture to segment images from a series of short-axis cardiac magnetic resonance slices (CMRI). The proposed model is an extension of the U-net that embeds a cardiac shape prior and involves a loss function tailored to the cardiac anatomy. Our system takes as input raw MR images, requires no manual preprocessing or image cropping and is trained to segment the endocardium and epicardium of the left ventricle, the endocardium of the right ventricle, as well as the center of the left ventricle. With its multi-resolution grid architecture, the network learns both high and low-level features useful to register the shape prior as well as accurately localize the borders of the cardiac regions. Experimental results obtained on the ACDC-MICCAI 2017 dataset show that our model segments multi-slices CMRI (left and right ventricle contours) in 0.17 second with an average Dice coefficient of 0.91 and an average 3D Hausdorff distance of 9.5 mm.