\documentclass{article}

\usepackage{geometry}
\usepackage{verbatim}
\usepackage{tabularx}
\usepackage{graphicx}
\usepackage{etoolbox}

\ifdefined\testinputfile\endcsname\else\input ../../../pacnw/ReadSamples.tex\fi

\title{Coprime Integers}
\problemname{CoprimeIntegers}
\date{}

\begin{document}
\maketitle
\begin{figure}[h!]
\centering
\includegraphics[width=0.4\textwidth]{CoprimeIntegers.png}
\end{figure}


Given intervals $[a, b]$ and $[c, d]$, count the number of pairs of
coprime integers $(x, y)$ such that $a \le x \le b$ and $c \le y \le d$.

Two numbers are coprime if their greatest common divisor is 1.
A divisor of a number is a positive integer that evenly divides
that number.

\section{Input}

The input consists of a single line containing space-separated integers
$a$, $b$, $c$, and $d$ ($1 \le a \le b \le 10^7$, $1 \le c \le d \le 10^7$).

\section{Output}

Print the result as a single integer on one line.

\sampleio{CoprimeIntegers}

\end{document}
