// Arup Guha
// 9/1/2026
// Solution to Fall 2026 COP 3330 Program #2A: Total Touring Distance

import java.util.*;

public class tourdist {

	public static void main(String[] args) {
	
		// Get # of stops.
		Scanner stdin = new Scanner(System.in);
		System.out.println("How many locations are on the tour?");
		int numLoc = stdin.nextInt();
		
		// Set up accumulator.
		int totaldist = 0;
		
		// Go through each leg of the tour.
		for (int i=1; i<numLoc; i++) {
			
			// Read in this leg.
			System.out.println("What is the distance, in miles, between location "+i+" and location "+(i+1)+"?");
			int dist = stdin.nextInt();
			
			// Update.
			totaldist += dist;
		}
		
		// Ta da!
		System.out.println("The band will travel a total of "+totaldist+" miles for their tour.");
	}
}