Most vertebrates are able to make detours and find shortcuts to achieve economical navigation. This ability requires the animal to keep track its direction and distance from specific locations. In rodents, direction of the animal is coded by the activity of head direction cells present in several regions of the brain, but distance information is only indirectly available, through the entorhinal cortical grid cell system. A neural system downstream from the entorhinal cortex seems to be necessary to extract the distance information from the periodic activity of grid cells. We propose that a system of such cells store the distance of the animal from important locations in the dentate gyrus region of the hippocampus and these "distance cells" might be identified with the dentate granule cells. A computational model is set up to study the neural mechanism of distance information decoding from the ensemble of grids cells. The proposed distance cells receive innervation from entorhinal grid cells, the connection strength between grid cells and distance cells is set by a one-shot-learning rule and the distance cell activity is affected by a winner-take-all mechanism. Simulation results of this model verifies that the activity of the distance cell population is able to unambiguously code the distance of the animal from important places. The proposed distance cells have a multi-peaked, patchy spatial activity pattern similar to the firing pattern of granule cells in dentate gyrus.