4. First solution. Let $a_{1}, a_{2}, \ldots, a_{15}$ be the days of the month that were sunny. Then Andrey Stepanovich will not drink a single drop from the 1st to the $a_{1}$-th day, he will drink one drop per day from the $a_{1}$-th day to the $a_{2}$-th day (including the $a_{1}$-th day but not the $a_{2}$-th day), and so on. In total, he will drink

$$
\begin{aligned}
& 1 \cdot\left(a_{2}-a_{1}\right)+2 \cdot\left(a_{3}-a_{2}\right)+\ldots \\
& \quad \ldots+14 \cdot\left(a_{15}-a_{14}\right)+15 \cdot\left(30-a_{15}+1\right)= \\
& \quad=15 \cdot 31-\left(a_{1}+a_{2}+\ldots+a_{15}\right)
\end{aligned}
$$

Ivan Petrovich, on the other hand, will drink a number of drops equal to the sum of the numbers of all days except $a_{i}$:

$$
\begin{aligned}
(1+2+\ldots+30)-\left(a_{1}+a_{2}+\ldots\right. & \left.+a_{15}\right) \\
& =15 \cdot 31-\left(a_{1}+a_{2}+\ldots+a_{15}\right)
\end{aligned}
$$
The second solution. First, let's consider the situation where the first fifteen days of April were cloudy, and the last fifteen were sunny. It is easy to check that both characters in the problem will drink $1+2+3+\ldots+15=120$ drops of valerian - indeed, equally.

Let's swap some sunny day $s$ with some cloudy day $p$ and see how the monthly doses of valerian change for both. Suppose that $s > p$. Note that Andrei Stepanovich, starting from day $p$ (not inclusive) to day $s$ (inclusive), will drink one drop of valerian more each day than before the swap, and in all other days, he will drink the same amount. Thus, he will drink $s-p$ drops more in total than before the swap. As for Ivan Petrovich, after the swap, he will also drink $s-p$ drops more than before, as he stopped drinking valerian on day $p$ and started on day $s$. Similarly, it can be proven that if $s < p$, the amount of valerian each character drinks will decrease by $p-s$.

Thus, the operation of swapping a cloudy and a sunny day changes the dose of valerian taken by both by the same number of drops. It remains to note that by swapping days, we can transform the initial month (with 15 cloudy days at the beginning) into any other.

The third solution. Consider a checkered "staircase": a figure consisting of 30 columns corresponding to the days in April, with as many cells in each column as the number of that day in the month (see figure). In each column, we will gray out as many cells as the number of drops of valerian Andrei Stepanovich drank on the corresponding day, and each column corresponding to a cloudy day will be filled with crosses.

![](https://cdn.mathpix.com/cropped/2024_05_06_242f9458f1fd20520bdbg-4.jpg?height=404&width=408&top_left_y=1324&top_left_x=482)

Thus, Andrei Stepanovich drank as many drops of valerian as there are grayed-out cells, and Ivan Petrovich drank as many as there are crosses in the table. It is sufficient to prove that the number of crosses in the unshaded cells is the same as the number of shaded cells without crosses.

The shaded cells without crosses are in the "sunny" columns. On each sunny day, Andrei Stepanovich drank one drop of valerian more than on the previous sunny day (on the first sunny day, he drank 1 drop). Therefore, the number of shaded cells without crosses is $1+2+3+\ldots+15$.

Now let's count the number of crosses in the unshaded cells. Suppose the $n$-th day was cloudy and there were $k$ sunny days before it. Then in the corresponding column, there will be $n-k$ "unshaded" crosses (and $k$ "shaded" ones). Note that this is the $(n-k)$-th cloudy day, so in the first cloudy day, there will be one unshaded cross, in the second - two, and so on. Thus, the number of unshaded crosses is $1+2+3+\ldots+15$.