import java.time.LocalDate;
import java.time.ZoneId;
import java.time.ZonedDateTime;
import java.time.temporal.ChronoUnit;

class Main {
    public static void main(String[] args) {
        // A sample hour indicated by the user
        int hour = 16;

        // Replace the ZoneId with the applicable one
        ZoneId zone = ZoneId.of("America/New_York");
        ZonedDateTime then = LocalDate.now(zone)
                                      .atStartOfDay(zone)
                                      .withHour(hour);

        ZonedDateTime now = ZonedDateTime.now(zone);
        System.out.println(now);

        if (then.isAfter(now))
            then = then.minusDays(1).withHour(hour);

        long seconds = ChronoUnit.SECONDS.between(then, now);
        System.out.println(seconds);
    }
}