Loops and Loops and Loops
JavaScript (ES6), 221 229

A function with the input as a parameter, output as a string via popup window (alert).

Scan repeatedly the input:
at each step 


remove the end of the tail 
count the remaining '#'


When there is not more tail to remove, the number of the steps so far is the size of the tail and the number of remaining '# is the size of the loop.

All the newlines inside backticks are significant and counted

Test running the snippet below with Firefox (not Chrome, as it does not support ...)



F=s=&gt;{s=`


${s}


`.split`
`.map(r=&gt;[...r]);for(t=0,f=1;f;)s.map((r,y)=&gt;r.map((c,x)=&gt;c=='#'&amp;&amp;((r[x+2]+r[x-2]+s[y-1][x]+s[y+1][x]).match`[v&lt;&gt;^]`?++l:t+=(f=r[x-4]=r[x+4]=s[y-3][x]=s[y+3][x]=r[x]=1))),f=l=0);alert(t+' '+l)}

// Less golfed
U=s=&gt;{
  s=`\n\n\n${s}\n\n\n`.split`\n`.map(r=&gt;[...r])
  t=0
  do {
    f=l=0
    s.forEach((r,y) =&gt; {
      r.forEach((c,x) =&gt; {
        if (c == '#')
        {
          if (!(r[x+2] == '&lt;' || r[x-2] == '&gt;' || s[y-1][x] == 'v' || s[y+1][x] == '^'))
            t+=(f=r[x-4]=r[x+4]=s[y-3][x]=s[y+3][x]=r[x]=1)
          else
            ++l
        }
      })
    })
  } while(f)
  alert(t+' '+l)
}  

//Test

// Redefine console.log
alert=(...x)=&gt;O.innerHTML+=x+'\n'

test=[`
# --&gt; # --&gt; #
      ^     |
      |     |
      |     v
      # &lt;-- #`
,`
            # --&gt; # --&gt; #
            ^           |
            |           |
            |           v
      # --&gt; # &lt;-- #     # --&gt; #
      ^           ^           |
      |           |           |
      |           |           v
# --&gt; #           # &lt;-- # &lt;-- #`
,`
# --&gt; # --&gt; # --&gt; #
^     ^           |
|     |           |
|     |           v
#     # &lt;-- # &lt;-- #`      
]

test.forEach(t=&gt;(alert(t),F(t)))
&lt;pre id=O&gt;&lt;/pre&gt;