/* package whatever; // don't place package name! */

import java.util.*;
import java.lang.*;
import java.io.*;
import java.time.*;
import java.time.temporal.*;
import java.time.temporal.ChronoUnit;

/* Name of the class has to be "Main" only if the class is public. */
class Ideone
{
	public static void main (String[] args) throws java.lang.Exception
	{
		LocalDate start = LocalDate.parse( "2016-01-31" );
		LocalDate stop = LocalDate.parse( "2016-02-01" );
		
		LocalDate startAdjusted = start.with( TemporalAdjusters.firstDayOfMonth() );
		LocalDate stopAdjusted = stop.with( TemporalAdjusters.firstDayOfNextMonth() );
	
		long calendarMonthsTouched = ChronoUnit.MONTHS.between( startAdjusted , stopAdjusted );

		System.out.println("span: " + start.toString() + "/" + stop.toString() );
		System.out.println("calendarMonthsTouched: " + calendarMonthsTouched );
	}
}