Dynamical nucleus-nucleus potential at short distances