A milking box includes two entrance fences and two exit fences. A first entrance fence and a first exit fence form a first pair of fences positioned at a first side of the milking box. A second entrance fence and a second exit fence form a second pair of fences positioned at a second side of the milking box which is opposite the first side. The first entrance fence operates independently of the second entrance fence, the first exit fence, and the second exit fence. The second entrance fence operates independently of the first entrance fence, the first exit fence, and the second exit fence. The first exit fence operates independently of the first entrance fence, the second entrance fence, and the second exit fence. The second exit fence operates independently of the first entrance fence, the second entrance fence, and the first exit fence.