[Question]
  [
## Challenge:
### Input:
A sorted list of positive integers.
### Output:
The amount of integers which are still at the exact same index, after rotating the digits in each integer its index amount of times towards the left and sorting the modified list again.
**Example:**
Input: `[8,49,73,102,259,762,2782,3383,9217,37846,89487,7471788]`  
Output (0-based indexing): `6`  
Output (1-based indexing): `5`
*Why?*
0-based indexing:
```
After rotating each: [8,94,73,102,592,276,8227,3338,9217,63784,89487,7887471]
Sorted again:        [8,73,94,102,276,592,3338,8227,9217,63784,89487,7887471]
Input indices:        0  1  2   3   4   5    6    7    8     9    10      11
Original input-list: [8,49,73,102,259,762,2782,3383,9217,37846,89487,7471788]
Modified list:       [8,73,94,102,276,592,3338,8227,9217,63784,89487,7887471]
Modified indices:     0  2  1   3   5   4    7    6    8     9    10      11
Equal indices:        ^         ^                      ^     ^     ^       ^
So the output is: 6
```
1-based indexing:
```
After rotating each: [8,49,37,021,925,762,2278,3383,2179,37846,94878,8874717]
Sorted again:        [8,(0)21,37,49,762,925,2179,2278,3383,37846,94878,8874717]
Input indices:        1  2  3   4   5   6    7    8    9    10    11      12
Original input-list: [8,49,73,102,259,762,2782,3383,9217,37846,89487,7471788]
Modified list:       [8,21,37,49,762,925,2179,2278,3383,37846,94878,8874717]
Modified indices:     1  4  3  2   6   5    9    7    8    10    11      12
Equal indices:        ^     ^                               ^     ^       ^
So the output is: 5
```
## Challenge rules:
* The input-list is guaranteed to only contain positive integers.
* The input-list is guaranteed to be sorted from lowest to highest.
* The input-list is guaranteed to contain at least two items.
* As you can see above, both 0-based and 1-based indexing is allowed. **Please state in your answer which of the two you've used, since outputs can differ accordingly!**
* Leading `0`s after rotating are ignored, which can be seen with the 1-based example above, where the integer `102` becomes `021` after rotating, and is then treated as `21`.
* Integers are guaranteed unique in the input-list, and are guaranteed to remain unique after the rotations are completed.
* Note that we only look at the positions of the rotated integers in correlation with the positions of the input, not with the values of the input-list. To clarify what I mean by this: with the input-list `[1234,3412]` and 1-based indexing, the list becomes `[2341,1234]` after rotating each integer it's index amount of times, and then when sorted becomes `[1234,2341]`. Although both the original input-list and the rotated list contains the integer `1234` at the leading position, they aren't the same! The rotated `1234` was `3412` before. The 1-indexed output for this input-list is therefore `0`, since the two integers have swapped their positions.
* Input is flexible. Can be a list/stream/array of integers/strings/digit-arrays, etc. Please state what you've used if you don't take the inputs as integers.
## General rules:
* This is [code-golf](/questions/tagged/code-golf "show questions tagged 'code-golf'"), so shortest answer in bytes wins.  
Don't let code-golf languages discourage you from posting answers with non-codegolfing languages. Try to come up with an as short as possible answer for 'any' programming language.
* [Standard rules apply](https://codegolf.meta.stackexchange.com/questions/2419/default-for-code-golf-program-function-or-snippet/2422#2422) for your answer with [default I/O rules](https://codegolf.meta.stackexchange.com/questions/2447/default-for-code-golf-input-output-methods/), so you are allowed to use STDIN/STDOUT, functions/method with the proper parameters and return-type, full programs. Your call.
* [Default Loopholes](https://codegolf.meta.stackexchange.com/questions/1061/loopholes-that-are-forbidden-by-default) are forbidden.
* If possible, please add a link with a test for your code (i.e. [TIO](https://tio.run/#)).
* Also, adding an explanation for your answer is highly recommended.
## Test cases:
```
Input: [8, 49, 73, 102, 259, 762, 2782, 3383, 9217, 37846, 89487, 7471788]
0-based output: 6
1-based output: 5
Input: [1234, 3412]
0-based output: 2
1-based output: 0
Input: [2349, 2820, 17499, 21244, 29842, 31857, 46645, 56675, 61643, 61787]
0-based output: 3
1-based output: 0
Input: [4976, 11087, 18732, 22643, 52735]
0-based output: 2
1-based output: 3
Input: [4414, 5866, 7175, 8929, 14048, 16228, 16809, 19166, 24408, 25220, 29333, 44274, 47275, 47518, 53355]
0-based output: 4
1-based output: 4
Input: [11205, 16820, 63494]
0-based output: 1
1-based output: 3
```
Feel free to generate more random test cases with (or draw inspiration from) [this ungolfed 05AB1E program](https://tio.run/##yy9OTMpM/f9f6Ujj4R0u57YeafdT0Is/uvDw@tpziy/srX3UMOvwjnNbHzWtObfjcHetv5JyKJeSZ15BaYmVgpL94f0@57Ye3efhc25lbfWhlTpcSga6SYnFqSkK@aUlUDWH1kV46YUBpQyxSanbHd4LlP3/39AAAA), where the input is the size of the random list (NOTE: the output of this generator might not comply with the rule "*Integers are guaranteed unique in the input-list, and are guaranteed to remain unique after the rotations are completed*", so keep that in mind when using it.)
  
[Answer]
# [R](https://www.r-project.org/), ~~114~~ 107 bytes
-5 bytes thanks to Giuseppe. 
[Outgolfed](https://codegolf.stackexchange.com/a/186219/86301) by digEmAll.
```
function(l){for(j in seq(l))l[j]=rep(l[j]%/%(e=10^(b=nchar(l[j]):1-1))%%10,j+1)[j+0:b]%*%e
sum(sort(l)==l)}
```
[Try it online!](https://tio.run/##NY/RbsIwDEXf@Yq8VEpGpsWOEztI/RLEpIFajaorW4Gnad/eORU8Xfvq@tiel75d@vt0up0vkx3db3@Z7WDOk7l2P9q7cT8c2rn7trVo3hrbtRDe7bGdTp8f8@q6HbyCc00DwQ9bcPthG3bHQ/PSdJvr/cteL/NNUW07ur@ltycrnorn6CGgx6RlVmVBH6NEXxDYRxbKXgoJeyYGFnFuU4cBI3kTCfBhaF@8QcHgDTCV2gCShrAIoWZBEntDOVPyJuXMKhkyxSos/ABR4awICLrTgHDUWcQ1lpBjesYIlJ0ka1gPU5YU1KVAgUQlI64ioZoFak7PCWpiwnollhgVSoSsJGKsEOIEGkkxpucmAAxpRdWprH@Sc8s/ "R – Try It Online")
0-indexed.
Ungolfed version:
```
function(l) {
  n = length(l)                         # size of input
  for (j in 1:n) {  
    b = nchar(l[j]) -1                  # number of digits in l[j] -1
    e = 10 ^ (b:0) 
    d = l[j] %/% e %% 10                # convert to vector of digits
    l[j] = rep(d, j + 1)[j + 0:b] %*% e # rotate digits and convert back to an integer
  }
  sum(sort(l) == l)                     # number of integers which are in the same position
}
```
To rotate the `b` digits of an integer by `j` positions, the code repeats the digits many times, then takes the digits in positions `j+1` to `j+b`. For instance, to rotate `102` 4 times, keep the values marked with an `x` (positions 5 to 7):
```
102102102102
    xxx
```
so the result is `021`.
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E), 9 bytes
```
ΣN._ï}-_O
```
[Try it online!](https://tio.run/##yy9OTMpM/f//3GI/vfjD62t14/3//4@20DGx1DE31jE0MNIxMgUyzYC0uYWRjrGxhbGOpZGhuY6xuYWJmY6FpYmFuY65ibmhuYVFLAA "05AB1E – Try It Online")
Uses 0-based indexing.
Explanation:
```
Σ    }       # sort the input by
 N._         # each number rotated its index to the left
    ï        # then cast to int (otherwise the sort is alphabetic)
      -      # subtract the input from the result
       _O    # then count the 0s
```
[Answer]
# [Japt](https://github.com/ETHproductions/japt) [`-x`](https://codegolf.meta.stackexchange.com/a/14339/), ~~10~~ 9 bytes
0-based
```
í¶UñÈséYn
```
[Try it](https://petershaggynoble.github.io/Japt-Interpreter/?v=1.4.6&flags=LXg&code=7bZV8chz6Vlu&input=WzgsNDksNzMsMTAyLDI1OSw3NjIsMjc4MiwzMzgzLDkyMTcsMzc4NDYsODk0ODcsNzQ3MTc4OF0)
```
í¶UñÈséYn     :Implicit input of integer array U
í             :Interleave with
  Uñ          :U sorted by
    È         :Passing each integer at 0-based index Y through the following function
     s        :  Convert to string
      é       :  Rotate right by
       Yn     :    Y negated
 ¶            :Reduce each pair by testing for equality
              :Implicit output of sum of resulting array
```
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), 9 bytes
```
Dṙ"JḌỤ=JS
```
[Try it online!](https://tio.run/##y0rNyan8/9/l4c6ZSl4Pd/Q83L3E1iv4////0RY6JpY65sY6hgZGOkamQKYZkDa3MNIxNrYw1rE0MjTXMTa3MDHTsbA0sTDXMTcxNzS3sIgFAA "Jelly – Try It Online")
Monadic link that takes a list of integers and returns an integer indicating the number of integers that remain in place after performing the rotation using 1-indexing.
### Explanation
```
D         | Convert to decimal digits
 ṙ"J      | Rotate left by index
    Ḍ     | Convert back to integer
     Ụ    | Index in sorted list
      =J  | Check if equal to index in original list
        S | Sum
```
[Answer]
# [Python 2](https://docs.python.org/2/), ~~104~~ ~~100~~ ~~97~~ 93 bytes
```
b=[int((s*-~i)[i:i+len(s)])for i,s in enumerate(input())]
print map(cmp,b,sorted(b)).count(0)
```
[Try it online!](https://tio.run/##LVDBboMwDL33KxCXko1NsePESaV9CeLQdkyN1AICqm2X/XoHdi/Js/P83ovH3@Uy9Pj4vuRrV8Ch@@nO@/3@cfpocr9U1fzy9pdNkw/59dr11Wxa8zVMRa7nIvdF199v3XRcuir3432pjGl347QOFrfjWJ1vY32q52Faus/qZMz7ebivmtY8NoemjGVdlJS2k912gsXtQq@9oBVHuZ2LQkoILDVHChuIiaJ0mBg4xrLdNSWgI2ERoDTWWlQxohUvpqQNQBIqpkjqBNGLIIVAfgM@BBYQIJBTwKvpJkyJJQaA1RgQ2WlyfJI9svNKJhAvH4MMrYG9/gElDJAlWQsExCeIVp8S6Mwa10bdE@pfMDknRkTIok@MKkzsQcjeOa8ZAND6p7TOh3U3VLb/ "Python 2 – Try It Online")
0-based indexing.
First rotates each number, and then compares the result with result, but sorted.
---
Saved:
* -3 bytes, thanks to Erik the Outgolfer
* -4 bytes, thanks to Kevin Cruijssen (and his rule-change)
[Answer]
# [R](https://www.r-project.org/), ~~90~~ ~~88~~ 85 bytes
```
function(x)sum(rank(as.double(substr(strrep(x,L<-sum(x|1)),y<-1:L,y+nchar(x)-1)))==y)
```
[Try it online!](https://tio.run/##NY9NbgIxDEb3PcUsE9VU8U9ip4IbcAmgoFalQzXDSIPUu08dBIvoS6znZ2dYTpvlNPWH69elD3Mcp58w7PrvsBvfPi7T/nwM47Qfr0PwMxx/wwzb9apR8x/GCLf1Ct@3cHvtD5@7wQUrr8bN5haXUzgEA6mgDJgIKPu1eKoRMBtDJVRgNSlgVUxBRVHNYnxpzUgs0LEgPQr@rtCRUYIOVWp7IIlDVE3IWbSs0EkpkqHLpahHwSLcQk0fIqlaXIHJZ3Zoyt5LdMcyKecnJujubMVhX8xdVsmHoiQxj0J0D0utWLFxvk7yImVqW1JldqkIqZtEqUlEMzqSmfNzEiKlfFe1ruL/lBiXfw "R – Try It Online")
* 0-indexed rotation
* rotation strategy inspired by [@RobinRyder's answer](https://codegolf.stackexchange.com/a/186173/41725)
* -5 bytes thanks to @Giuseppe
### Unrolled code with explanation :
```
function(x){
    L=sum(x|1)                         # store the length of x
    R=strrep(x,L)                      # repeat each string of vector x L times
    S=substring(R,1:L,1:L+nchar(x)-1)) # for each string of R, extract a substring of the same 
                                       # length of the original number starting from index 1 
                                       # for the 1st element, index 2 for the 2nd and so on
                                       # (this basically rotates the strings )
    Y=as.double(S)                     # convert the strings to numbers
    sum(rank(Y)==1:L)                  # return the number of times the ranks of Y
                                       # match with their original positions
}
```
[Answer]
# [J](http://jsoftware.com/), ~~28~~ 26 bytes
-2 bytes thanks to Jonah
```
1#.i.@#=[:/:#\".@|.&>":&.>
```
[Try it online!](https://tio.run/##TU/LSgNBELznK4osJAg6Tr97FhICgidPXvUmBvXiD/jvaycL4mF6mqKquupr2bb9GYcZe9yiY6531/Dw/PS40NQ@22k6vMz38/S6baeftjtu5107LjcbbN7fPr5hOOCMhA6EgDqDrVavP5IhkoLBFJBIdeTQDIQGRebq0K8OxKIQJf4PFjbAyR0UOmolVgWP1HKmtIC6q8Hcw@DkKjUjYzWRq4mOcBD1uksZUsH4wjMOsZWnK09JYemOCmeVlAdIuybImS8zeyGDilExelZTrmg8RKTUHAoNLqmGUcJEzP6CVEPibheX0ngV0@UX "J – Try It Online")
[Answer]
# [Stax](https://github.com/tomtheisen/stax), ~~11~~ 10 [bytes](https://github.com/tomtheisen/stax/blob/master/docs/packed.md#packed-stax)
```
ìát'óJ♣á◄·
```
[Run and debug it](https://staxlang.xyz/#p=8da07427a24a05a011fa&i=[%228%22,+%2249%22,+%2273%22,+%22102%22,+%22259%22,+%22762%22,+%222782%22,+%223383%22,+%229217%22,+%2237846%22,+%2289487%22,+%227471788%22]%0A[%221234%22,+%223412%22]%0A[%222349%22,+%222820%22,+%2217499%22,+%2221244%22,+%2229842%22,+%2231857%22,+%2246645%22,+%2256675%22,+%2261643%22,+%2261787%22]%0A[%224976%22,+%2211087%22,+%2218732%22,+%2222643%22,+%2252735%22]%0A[%224414%22,+%225866%22,+%227175%22,+%228929%22,+%2214048%22,+%2216228%22,+%2216809%22,+%2219166%22,+%2224408%22,+%2225220%22,+%2229333%22,+%2244274%22,+%2247275%22,+%2247518%22,+%2253355%22]%0A[%2211205%22,+%2216820%22,+%2263494%22]&a=1&m=2)
This program uses 0-based indexing and takes input as an array of strings. I saved a byte by taking opportunity of the new input clarificatinos.
[Answer]
# [Perl 5](https://www.perl.org/) `-pa`, 80 bytes
```
map$d{$_.substr$_,0,$b%y///c,''}=$b++,@F;$\+=$d{$_}==$r++for sort{$a-$b}keys%d}{
```
[Try it online!](https://tio.run/##HcpNC8IgGADgv@LhHTuoU9ccRQiduvUPgqFtwehDUTsM8a/3Bj3nJyzxqRFfNsBcYOrSx6UcYWKSgWs2IcSNtW014Chlp/MRrtT8ZzUGIqV3H0nyMRewHFx9LFtq5loQleqlJmrc95KMu@EwfH3Iq38n5BfdSSWR2/AD "Perl 5 – Try It Online")
Takes input as space separated numbers on STDIN; gives 1-based result.
[Answer]
# [Pyth](https://github.com/isaacg1/pyth), 15 bytes
```
sqVSJ.ev.<`bkQJ
```
[Try it online!](https://tio.run/##HYxBCkIxDAWvkgOET5O8NC14gr/7CG5EEEEQ3CiK4Olr6mpgGObxfd/GeD0P@3W5fpbd@XLf1jGOgIDJW61MIeFMrWtnEhS0RFX9o5Upu8xOgZJSXbUkupkxARp5QuicIFwycTP30w8 "Pyth – Try It Online") Uses 0-based indexing.
```
sqVSJ.ev.<`bkQJ   Implicit: Q=eval(input())
     .e      Q    Map elements of Q, as b and with index k, using:
          `b        Convert b to string
        .<  k       Rotate the above left k places
       v            Convert back to integer
    J             Store the above as J
   S              Sort the above
 qV           J   Vectorised equality check with the unsorted list
s                 Sum, implicit output
```
[Answer]
# APL+WIN, ~~23, 21~~ 19 bytes
2 bytes saved by inputting the integers as a nested vector of characters
```
+/i=⍋⍎¨(i←⍳⍴v)⌽¨v←⎕
```
1 indexed.
```
v←⎕ prompt for input. 
(i←⍳⍴v)⌽¨ rotate each set of characters by input indices.
⍋⍎¨ convert characters to integers and get sorted indices.
+/i= sum where original and sorted indices are the same.
```
[Try it online! Courtesy of Dyalog Classic](https://tio.run/##JY9BSgRBDEX3fQp3rchgJZVUUgtvoIdoRkYaGhQGBryACtqNm7nD7HXrZo5SF2mTuMmv/Ererxqep83DyzA9PW6207Dfj9u1Lcf7u/b6lbv2/rZbr2/G2zZ/tHk5ny5H89v83eafw1X7/D2fDm4sx9VG113Xa3/RU7Ui2QoktIocRomzqEvO6vcVQbwTpWKqldR7IQFR7TsDYg4cKiYHCtVoAYlcq1LwQNk3qRRiUy5FXAsUyqFiZOcRgS@yFk@0HI5gdCpQIv8AFMR/1RR@hZi2zKTxIYzXYM3Z6UQoDiXBwJEw@BznzNz/AQ "APL (Dyalog Classic) – Try It Online")
[Answer]
# [JavaScript (Node.js)](https://nodejs.org), ~~107~~ ~~99~~ 95 bytes
-8 bytes Thanks @Shaggy for accepting array of strings instead. Further golfed 4 bytes from this. Will not trigger memory error this time.
```
a=>[...b=a.map(F=(x,i)=>i--?F(x.slice(1)+x[c=0],i):x)].sort((p,q)=>q-p).map(x=>c+=x==b.pop())|c
```
[Try it online!](https://tio.run/##bVDBbsIwDL3vK3pMRBrVjhOnm8Ju/ARCousAdWK0UDT1sH/vHKZdpl7i2M9@79kfzVcztrduuJeX/v0wH1OT1ifV2M9mUFNaT6v9XuunU5qlvrXWvqVfbJPUZDqd1l1Zvm7UZMdz1x4U6NW0bVO1E@x50js79re7UoO5Suu1HPQfcbtKU0pvdugHpfV3O7@0/WXszwd77k/qqLbRFFSbgp0poEJToM9ZyD@O8joXBaoRWP4cKZgi1hQlY2LgGHfi@z8poCNpJ8AlVEDRwIiVaDLVOQEkmcA6UtaE6EWAQiBvCh8CSwgQyOXAkZdYqWbxBlBlbxDZ5RXwMeORnV@cIRBVH4NMyjI@74ZiB6giOQwExEeIVS7WkPvEaBXznTD7x9o5USBCFiZizCTEHqTFO@cXZQGw8g/eTBHkHCRt8w8 "JavaScript (Node.js) – Try It Online")
# [JavaScript (Node.js)](https://nodejs.org), ~~111~~ 107 bytes
-4 bytes Thanks @Arnauld!
```
a=>[...b=a.map((x,i)=>"".padEnd(x+i,x+=c='').substr(i,x.length))].sort((p,q)=>q-p).map(x=>c-=x==b.pop())|-c
```
[Try it online!](https://tio.run/##bVC5bsMwDN37FUaWSKgsmBQlyiiUrV8RZHCcoylS24ndwkP/3aUyFllE8XgH@dn8NGN7vwxT2fWH43JKS5M2W2vtPjX2qxmUms1Fp81qZYfm8N4d1Px6MfNratN6re34vR@nu5KKvR678/Sh9c6O/X1SajA3wd3KQT945rRpyzSntLdDPyitf8t2eWv7buyvR3vtz@qkttEUVJuCnSmgQlOgz1nIP47yOhelVSOw/DlSMEWsKUrGxMAx7rR@@U8K6EjGCfBZV5qigREr0WSqcwJIgsA6UtaE6EWAQiBvCh8CSwgQyOXAkZ@xUs3iDaDK3iCyyyvgA@ORnX@KIRBVH4MgZRmfd0OxA1SRHAYC4iPEKhdryHNitIr5Tpj9Y@2cKBAhCxMxZhJiDzLinfNPZQGw8g/eTBHkHCRjyx8 "JavaScript (Node.js) – Try It Online")
# [JavaScript (Node.js)](https://nodejs.org), ~~113~~ 111 bytes
```
a=>[...b=a.map((x,i)=>"".padEnd(x+i,x).substr(i,`${x}`.length))].sort((p,q)=>p-q).map((x,i)=>x-b[i]||c++,c=0)|c
```
[Try it online!](https://tio.run/##bVDNboMwDL7vKVC1A1HTCDtOHDTR256iqlRKf8bUAS1sQlr37MzpaZq4xHbs78d@L7/KvrrV3bBq2sNxOhVTWaw3xph9UZqPskvTUdeqWC8WpisPr80hHZe1HpXpP/f9cEtrvXv@Hn925nJszsObUlvTt7chTTt9FVi3uqq/NONqv6m393u1XOqqyNS9ml6qtunby9Fc2nN6SjdBJ5TrhK1OIEOdoIuVjxkHea0N0soRWHIO5HUScgpSMTFwCFulnv6TAlqScQKc60pTNDBgJppMeSwASRCYB4qaEJwIkPfkdOK8ZwkePNkYOPAcK@Us3gCy6A0C27gCPjAO2bpZDIGouuAFKcu4uBuKHaCM5DDgER8hZPEzhzgnRrMQ74TRP@bWigIRsjARYyQhdiAjzlo3KwuAmXvwRgov5yAZm34B "JavaScript (Node.js) – Try It Online")
0-indexed. May trigger memory error for very large entries.
[Answer]
# [Perl 6](https://github.com/nxadm/rakudo-pkg), 50 bytes
```
{sum ^$_ Z==sort {+[~] rotate .[$^i].comb,$i},^$_}
```
[Try it online!](https://tio.run/##HY/BasMwDIbvfQodwkiYKZYsW/IhL7LSlm60UFjISLJDKd2rZ1Iuln/r96dfP9fpu6zDA95u0K/P@XeAU3OGj76fx2mB5/vh7wjTuFyWK@wPzel@3H@Nw2do7q9gxtc6Xx5wa5tzB7dx2rUagGsASQEwUgDKrorfRO1MSa1VCcXuolwCaGU1JSwoql3YtUiJrc1IrkwYg5SiMYWrCyQ2B1VlZ6JmA3ApnAPkUsRKwcLJi6g4havYLMTos1AleSTaPJkk5c3DaNSsxZwWJns2snHIkW0xLERb0eiPFd1nQaL6nuT5qKZkRGYSI7GQQ1gymiWnlLcxiBTzxvEvxdbjLqz/ "Perl 6 – Try It Online")
0-based indexing. Also exposed a [Rakudo bug](https://github.com/rakudo/rakudo/issues/2937).
### Explanation
```
{                                                }  # Anonymous block
            sort                              ^$_   # Sort indices 0..n
                 {                          },  # by
                              .[$^i]            # element at index i
                                    .comb       # split into chars
                       rotate            ,$i    # rotated i times
                   [~]  # joined
                  +     # converted to number
     ^$_ Z==  # Pairwise equal to original indices 0..n
 sum   # Sum of equal indices
```
[Answer]
# [PHP](https://php.net/), ~~159~~ ~~141~~ ~~134~~ 130 bytes
```
function($a){foreach($a as$x){for($j=$i;$j--;$x=substr($x,1).$x[0]);$b[$x]=$i++;}ksort($b);foreach($b as$z)$y+=++$j==$z;return$y;}
```
[Try it online!](https://tio.run/##ZVJNa9tAEL37VyxhQRJSimZ29kNVRQ@l0EOhuRsRbFfGcUEylgxKgn@7O7N2fMllvvbNm8fMHnaHy7fvh91B6a1qLttTv5lehj7Vq@x9Oxy71WbHsVqNeo6FVO8b/VLr/eNjredmPK3HiYtzAdkXPS/LNqv1eqnnllF5Xp//jcNxSvU6q@9sa2F7y/Rr3uQ50zX6rT520@nY69f6fKkXCz114zSqRi0XSi2TkBQJVWy8YQMlskUbCy7GPogzJsh7heAl84Ec@1BRkNyTBx9C0haRE9CQoAjwo8QV4cSApYzxVMUUkASJVaA4BYIVPnKOLHvrnBfvwJGJ3vO8GyVVXjQAlFEDBG@iYLxiLXpj71gCmWODkxYWa6N6FBFAJckWwCFefShjvYKIZolliFvBKB4rY2QAEXohJY@RjrwFwVlj7H0wAJb2ShqbHe@BknbR8iVuR1Oput1kNXKkMvXOrd1mN6j9OPTPXb8Z/nZpfCrU06@n559/ftcfkIcfw6mfvqqHgj/ZJ9D58h8 "PHP – Try It Online")
Zero-based indexing.
***Ungolfed:***
```
function( $a ) { 
    // iterate through digits
    foreach( $a as $x ) {
        // rotate the digits the number of times based on their index
        for( $j = $i; $j--; ) {
            // move first digit to last digit
            $x = substr( $x, 1 ) . $x[0];
        }
        // the new number is used as key for sort, value is the original index
        $b[ $x ] = $i++;
    }
    // sort by the new numbers
    ksort( $b );
    // iterate sorted array
    foreach( $b as $z ) {
        // if new index matches original index, increment count ($y)
        if ( ++$j == $z ) {
            $y++;
        }
    }
    return $y;
}
```
* -4 bytes taking input as array of strings, thx to @KevinCruijssen for pointing that out.
[Answer]
# [K (Kona)](https://github.com/kevinlawler/kona), ~~25~~ 21bytes
-4 bytes thanks to ngn!
```
{+/t=<.:'(t:!#x)!'$x}
```
[Try it online!](https://tio.run/##DcZNCoAgEAbQq3xSUBH96FgzSh2mjRuhNi6E6Ozm6r04xee@Sgn@HZd0HrPv@uRVkwfVtfkrAQLrwAS9Gpitdq@yGBAJwRnNIBa7Q5wVBlvWLFJ@ "K (Kona) – Try It Online")
[Answer]
# T-SQL query, 99 bytes
Sql has no rotating method, so I had to implement my own syntax, since this is a query, it had to be done without looping.
0-based indexing.
Using a table variable as input.
```
SELECT-sum(1/~(z*3))FROM(SELECT~i+rank()over(order by
substring(n+n,i%len(n)+1,len(n))*1)z FROM @)c
```
**[Try it online](https://data.stackexchange.com/stackoverflow/query/1064982/rotated-position-of-integers)**
[Answer]
# [Icon](https://github.com/gtownsend/icon), 141 bytes
```
procedure f(l)
n:=0
b:=[]
t:=l[k:=1to*l]&m:=k%*t&t:=t[m+1:0]||t[1:m+1]&put(b,[+t,l[k]])&\x
l[i:=1to*l]=sortf(b,1)[i,2]&n+:=1&\x 
return n
end
```
[Try it online!](https://tio.run/##ZVHLbsMgELz7K7jUshsO7LKwiyV/CfWhD0eymjiVS9Qe8u/pEqlSlXIZ2J2ZHWB5Pa3X68d2ep3fztts9t2hb9ZhdM3LMOapKcN4yO/DCOX0eJja4zC@PzyWVsslH3cwuOlyKRkG3U/tx7l0LzbvilXNNPXt03dzyMuvevw8bWWvDOjzYnFq1522lGSabS7nbTVrM69vf9Icn5e16xuj62tbytztuyyWkmVvwaHFoNuoyILWe/E2IbD1LBStJBK2TAwsMvV3NoCerPEE@K@lnWQNCjprgCnVAyApHZMQqgoksDUUIwVrQoysECGSr8DC/ywpcVQzcJrIgLBXF8SbICD7oAJzpyDQgUGi6vQGOkASahIgR6IQEW8grhYTVJ5mdFrEgDU6Ju/VnwhZnYixmhAHUErwPoT7lCYDoAs312oQ9R2okuqn/AA "Icon – Try It Online")
1-based indexing
[Answer]
# [Perl 5](https://www.perl.org/), 104 bytes
```
sub f{my$i;grep/\d+$/&&$i++==$&,sort{$a<=>$b}map{my$n=shift;map$n=~s/(.)(.+)/$2$1/,1..$_;"$n.$_"}0..$#_}
```
[Try it online!](https://tio.run/##bUzbToQwEH3fr5jUCYEwoVvK0mKt@iEmGzbCSpRLaI3ZbPDXsWyMT87LmXOdmvnjsK7u8wTttb9gZ85zM/GX1xR5FGGXptZiRG6c/RXrB/uIp6Wvpy06WPfWtd4EGv5vx@MsibM04Zij4CSyDI@G4RCALfvA7o7L2l/g2TfO21hTUZGSJPY55YfwlgGVzklKLanKhSKpdFGSrgqtSBVKKK0TswsTeB49WGjj21bQprkb/B8Ha6Hcwe2egI3vBF918EvYeluZ/br3wIYg/Zcw6w8 "Perl 5 – Try It Online")
0-based indexing in Perl. Ungolfed and commented:
```
sub f {
  my $i;                            #index counter
  grep /\d+$/ && $i++==$&,          #keep/return elems where $i matches original index stored as decimals
  sort { $a<=>$b }                  #sort rotated elems numerically (<=> is the numerical comparison op
  map {                             #loop through input
    my $n = shift;                  #shift(@_) got elem from input array @_
    map $n=~s/(.)(.+)/$2$1/, 1..$_; #rotate left times current index 
    "$n.$_"                         #use rotated number with original index number as decimals (to dont affect sort)
  }
  0..$#_
}
```
[Answer]
# [Ruby](https://www.ruby-lang.org/) `-ap`, 77 bytes
1-indexed. Was temp deleted earlier because I missed part of the spec.
`-p` reads a line of STDIN, and outputs `$_` at the end. `-a` splits that read line by spaces and saves it as `$F`.
```
i=0
$_=$F.zip($F.sort_by{|s|s.chars.rotate(i+=1).join.to_i}).count{|a,b|a==b}
```
[Try it online!](https://tio.run/##Dca7DoMgFADQvV9xBwdNWyKPeq8Da3/DgGlSOggBHKz466VO58TVbrU63V@aSTdP9nWhPUk@5slue0klsfltYmLRZ5Nfrbtq3rGPdwvLfnJHx2a/Lnkv5maL0doetRKoEVAC7wWIx9nhFEmAlCRhFBxBIqkBaFSEgAo5Ev18yM4vqd5N@AM "Ruby – Try It Online")
[Answer]
# [Wolfram Language (Mathematica)](https://www.wolfram.com/wolframscript/), 65 bytes
```
o=Ordering
g=Count[o@MapIndexed[FromDigits@*RotateLeft,#]-o@#,0]&
```
[Try it online!](https://tio.run/##LY6xCsIwFAB3v6JQcJAnbZPYlw6FgCIUFMW1dAg2xgxNJD5BEL89dnC6G264SdPdTJrcVacU2lMcTXTeLmy7DS9PfVBH/ej8aN5m7PcxTDtnHT3V6hJIkzmYG0E@rIPKoRyWyarOk7Em/rOPBNEAcqhKBmwzaz0TJQPOJYeGVQgcpahBNkIioMAKpfxmRZGd5xFKPw "Wolfram Language (Mathematica) – Try It Online")
1-based. We take the input as a list of digit lists, which works because Mathematica orders lists by length, then lexicographically, i.e. just like the original numbers.
[Answer]
# [Bash](https://www.gnu.org/software/bash/), 204 201 bytes
The only interesting thing here (possibly) is the use of `eval`. The algorithm is also clunky in that it creates a sorted list then reads it in order to determine changed index/indices.
1-based solution. My thanks to @RobinRyder for the helpful rotation algorithm.
```
for((i=1;i<$#+1;i++));do eval s=\${$i};for((j=0;j<i;j++));do eval s=${s}\${$i};done;eval n=\${s:$i:\${#$i}};echo $n $i;done|sort -nk1,1|{ i=1;c=0;while read d j;do((i==j))&&((c++));((i++));done;echo $c; }
```
[Try it online!](https://tio.run/##XY5BCoMwEEWvMmAQxQpGrVpHb9KNTVJMKgZMaRfq2dMYXHU18OfN/PcYzGiNeEOaQnmrK6A0a2qgTV3kkOdVWcA1r4urfeolimRPUXYkSNxIkjhGrkF8hglMfycrkTt6TPUZqk6i@mPIavaT43oW6OP5ODUtka2bgdvtKNiogcxApOc2oxcnOL/ohW4rHBLMNXxHOQlYxMCBg3Lk4derOA7DKGK@2iWnwtHmvzKE3Vr7Aw "Bash – Try It Online")
Revised code following Kevin's comments;
[Try it online!](https://tio.run/##VY5BCoMwEEWvMmAQxQpGrbGOuUk3VlNMKgZMaRfq2dMY3HQ18OfN/PfozGiNeEOaQnljFVCa1QxozYoc8rwqC7jmrLjap16iSPIMk0S2nAQYxzhoEJ9uAsPvZCVyRw8pB6lWokqSP4asZj@5Qc8CfTwfp6YhsnEzcLsdRT9qIDMQ6bnN6MXpzS96odsKklPsXcN3lJOARXQDDKAcedhxFcdhGEW9r3bJqXC0@a897tbaHw "Bash – Try It Online")
[Answer]
# [Scala](http://www.scala-lang.org/), ~~200~~ 160 bytes
```
def f(a:Seq[String])=
  a.zipWithIndex
   .map(x=>{val r=x._2%x._1.size;x._1.drop(r)+x._1.take(r)->x._2})
   .sortBy(_._1.toInt)
   .zipWithIndex
   .filter(x=>x._1._2==x._2)
   .size
```
[Try it online!](https://tio.run/##VU7BSsQwEL3vV4TCQoIabFo3aSULetvzIh5EyrhNd6PdtKZBulv67TXJQfDyZt68mTdvOEALS/fxqQ4OjWha1apBZ9AGgz0OJXqyFi5ve2e1Ob6TEr0Y7ZBE0xL2GgzlXn3/yRLoVfev2p12plYjPUOPR7mdfqBFVo60YmsPKR30VT3GrrZdjy25icTBl/Lkbhs2Z0KHzrrnC66i1u2MI//tG906ZcOHeF4xGX@Q6L/0PpNrDfYpfUaciOQ2yQsPPPOQ3jOP7CEONrHnIpQsE0EvWMoD4yLf@CqKXATOc55yIRJCEFnN8/IL "Scala – Try It Online")
0-indexed. 160 chars after removing indentation and newlines. This prints 6:
```
println( f(Seq("8","49","73","102","259","762","2782","3383","9217","37846","89487","7471788")) )
```
[Answer]
# [Vyxal](https://github.com/Lyxal/Vyxal), 12 bytes
```
µ¥Ǔ&›₀β;=';L
```
[Try it Online!](https://lyxal.pythonanywhere.com?flags=&code=%C2%B5%C2%A5%C7%93%26%E2%80%BA%E2%82%80%CE%B2%3B%3D%27%3BL&inputs=%5B8%2C49%2C73%2C102%2C259%2C762%2C2782%2C3383%2C9217%2C37846%2C89487%2C7471788%5D&header=&footer=)
```
µ      ;     # Sort by...
 ¥           # Register
  Ǔ          # Shift right by
   &›        # Increment register
     ₀β      # Cast to int
        =';L # Find those where they're equal
```
]