# Mock AIME 5 2005-2006 Problems/Problem 3

## Problem

A $\emph hailstone$ number $n = d_1d_2 \cdots d_k$, where $d_i$ denotes the $i$th digit in the base-$10$ representation of $n$ for $i = 1,2, \ldots,k$, is a positive integer with distinct nonzero digits such that $d_m < d_{m-1}$ if $m$ is even and $d_m > d_{m-1}$ if $m$ is odd for $m = 1,2,\ldots,k$ (and $d_0 = 0$). Let $a$ be the number of four-digit hailstone numbers and $b$ be the number of three-digit hailstone numbers. Find $a+b$.